On Sat, 18 Jan 2025 at 17:07, Alex Herbert <alex.d.herb...@gmail.com> 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
> commons-parent/.gitattributes
> commons-rng/.gitattributes
> commons-statistics/.gitattributes
>
> The file can be a single line. For example the Statistics file is:
>
> * text=auto
>
> A while back we normalised the line ending in CSV. There is an example of
> how to do this under the git docs [1]:
>
> $ 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 commit -m "Introduce end-of-line normalization"

Useful.

However, I noticed the following in the math repo:

$ git ls-files src/site/xdoc/download_math.xml --eol
i/mixed w/mixed attr/text=auto        src/site/xdoc/download_math.xml

I tried the above commands, but they did not change the file.

> Alex
>
> [1] https://git-scm.com/docs/gitattributes/2.6.7
>
>
> On Sat, 18 Jan 2025 at 16:25, Piotr P. Karwasz <pi...@mailing.copernik.eu>
> wrote:
>
> > Hi sebb,
> >
> > On 18.01.2025 16:46, sebb wrote:
> > > On Sat, 18 Jan 2025 at 15:35, sebb <seb...@gmail.com> 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 LF as line ending
> > (see [1] for example) and files with CRLF endings have practically
> > disappeared. Another advantage of using `.gitattributes` is that
> > artifacts compiled on Windows are usually identical to those compiled on
> > UNIX.
> >
> > Piotr
> >
> > [1] https://github.com/apache/logging-log4j2/blob/2.x/.gitattributes
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to