Re: [ALL] CRLF line endings causing problems

2025-01-21 Thread Piotr P. Karwasz
Hi Dávid, On 21.01.2025 18:44, Dávid Szigecsán wrote: I'm not 100% sure this is a valid concern at the moment, but I think it could be. You can add exceptions to a `.gitattribute` file. For example the `mvnw.cmd` file in Logging repos is configured to always have CRLF line endings[1]. Piot

Re: [ALL] CRLF line endings causing problems

2025-01-21 Thread Dávid Szigecsán
Hi, If the LF is forced by anything (git config, gitattribute, checkstyle, etc), what will happen to the file based tests where there is a purposefully CRLF line ending, because the test covers a fixed issue that was specifically related to windows files. E.g. in CSV. I mean files here for example

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread Alex Herbert
On Sat, 18 Jan 2025 at 18:05, Piotr P. Karwasz wrote: > Hi Alex, > > On 18.01.2025 18:06, Alex Herbert wrote: > > $ echo "* text=auto" >>.gitattributes > > $ rm .git/index # Remove the index to force Git to > > $ git reset # re-scan the working directory > > $ git status# Show

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread Piotr P. Karwasz
Hi Alex, On 18.01.2025 18:06, Alex Herbert wrote: $ echo "* text=auto" >>.gitattributes $ rm .git/index # Remove the index to force Git to $ git reset # re-scan the working directory $ git status# Show files that will be normalized $ git add -u $ git add .gitattributes $ git

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread Piotr P. Karwasz
Hi Gary, On 18.01.2025 18:11, Gary Gregory wrote: Do you need this in each active branch? Does it work with PRs? Yes, I am afraid you need it in all the active branches. It works with PRs, since basically it converts CRLF to LF each time you call `git add`. Piotr

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread sebb
On Sat, 18 Jan 2025 at 17:07, Alex Herbert wrote: > > We already use .gitattributes in for example: > > commons-codec/.gitattributes > commons-geometry/.gitattributes > commons-lang/.gitattributes > commons-logging/.gitattributes > commons-math/.gitattributes > commons-numbers/.gitattributes > com

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread sebb
On Sat, 18 Jan 2025 at 15:35, sebb wrote: > > On Sat, 18 Jan 2025 at 14:31, Gary Gregory wrote: > > > > Git has a setting for that called core.autocrlf and it seems we need to > > tell people exactly how to use it and put that in our Readme files and > > source web pages. We should explain how to

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread sebb
On Sat, 18 Jan 2025 at 14:27, Gilles Sadowski wrote: > > Hi. > > Le sam. 18 janv. 2025 à 14:46, sebb a écrit : > > > > Several Git repos have files with CRLF line endings even when checked > > out on Unix or macOS. > > > > This can cause problems when editing, and can cause large commit diff > >

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread sebb
On Sat, 18 Jan 2025 at 14:31, Gary Gregory wrote: > > Git has a setting for that called core.autocrlf and it seems we need to > tell people exactly how to use it and put that in our Readme files and > source web pages. We should explain how to use it on macOS, Windows, Linux. The problem is that

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread Piotr P. Karwasz
Hi sebb, On 18.01.2025 16:46, sebb wrote: On Sat, 18 Jan 2025 at 15:35, sebb wrote: Ideally we need something that is part of the repo checkout. Has anyone experience of using .gitattributes? That looks as though it might be a solution. We are using `.gitattributes` in all Log4j repos with

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread Gary Gregory
Hi Piotr, Do you need this in each active branch? Does it work with PRs? TY for the tip! Gary On Sat, Jan 18, 2025, 11:25 Piotr P. Karwasz wrote: > Hi sebb, > > On 18.01.2025 16:46, sebb wrote: > > On Sat, 18 Jan 2025 at 15:35, sebb wrote: > >> Ideally we need something that is part of the re

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread Alex Herbert
We already use .gitattributes in for example: commons-codec/.gitattributes commons-geometry/.gitattributes commons-lang/.gitattributes commons-logging/.gitattributes commons-math/.gitattributes commons-numbers/.gitattributes commons-parent/.gitattributes commons-rng/.gitattributes commons-statisti

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread Gary Gregory
Git has a setting for that called core.autocrlf and it seems we need to tell people exactly how to use it and put that in our Readme files and source web pages. We should explain how to use it on macOS, Windows, Linux. We probably also need to point out using dos2unix on Windows to clean up messes

Re: [ALL] CRLF line endings causing problems

2025-01-18 Thread Gilles Sadowski
Hi. Le sam. 18 janv. 2025 à 14:46, sebb a écrit : > > Several Git repos have files with CRLF line endings even when checked > out on Unix or macOS. > > This can cause problems when editing, and can cause large commit diff > emails which obscure the actual change. > > I'm thinking it might be usef

[ALL] CRLF line endings causing problems

2025-01-18 Thread sebb
Several Git repos have files with CRLF line endings even when checked out on Unix or macOS. This can cause problems when editing, and can cause large commit diff emails which obscure the actual change. I'm thinking it might be useful to add a Checkstyle rule to detect such files. And/or maybe th