[cmake-developers] .gitattributes updates

Brad King brad.king at kitware.com
Tue Mar 17 15:04:57 EDT 2015


On 03/15/2015 09:02 PM, Robert Dailey wrote:
> I noticed that .gitattributes was not properly configured to utilize
> modern Git features:

Right, it was written back before Git had the 'text' and 'eol'
attributes.  Basically the strategy is:

* Use '-crlf' for files on which we want no conversion and make sure
  the repo blobs have the right newlines.
* Use 'crlf=input' for shell scripts to guarantee LF newlines.
* Let core.autocrlf decide everything else.  I personally prefer LF
  newlines on Windows, for example.

I wouldn't mind updating to use the modern capabilities but some of
our nightly testing machines may still have Git versions too old to
support 'text' and 'eol' so I'm hesitant to change the above.
I don't know when I'd have time to check them all.

> 3. General cleanup and removal of redundant attributes

Note that *.png is in .gitattributes because in some cases Git
fails to detect that they are binary and still converts the newlines
in the image header text.  I'm not aware of anything else in
the current .gitattributes that is not needed or is redundant.

> 1. Some files were not properly being handled by git

What files?  Perhaps we can at least get those corrected.

FYI, Utilities/cmbzip2/*.dsp are not used and could be deleted.

> 2. Git config settings on a per-machine basis affected the EOL
> normalization in the repository

We have server-side repository checks to prevent CRLF newlines
from appearing in files not marked as binary with -crlf.  Still,
this could be problematic for users working across platforms
locally.

Thanks,
-Brad



More information about the cmake-developers mailing list