Re: [PATCH 2/2] submodule: Tolerate auto/safecrlf when adding .gitmodules
- From
Jens Lehmann <jens.lehmann@web.de>
- Date
- Jun 21, 2012, 19:06 UTC
- Message-ID
- <4FE370B4.60404@web.de>
- In-Reply-To
- <20120620191132.GB31520@sigill.intra.peff.net>
Am 20.06.2012 21:11, schrieb Jeff King:
Show 11 quoted lines
> The only sane thing is to have a canonical in-repo representation. > Fortunately we already have the infrastructure for that, and in theory > it should be as easy as adding ".gitmodules text" to our built-in > gitattributes (you could even do "eol=lf", but I don't see a reason not > to respect the native line endings in the working tree, given that git > can handle the CRLFs just fine). > > I say "in theory" there because I am not sure whether specifying a file > as definitely text via attributes will actually suppress the safecrlf > check or not. IMHO, it should, since safecrlf is really about preventing > false positives via autocrlf or text=auto.
A quick test shows that unfortunately theory differs from practice here. Adding ".gitmodules text" to the built-in gitattributes lets the test Brad wrote still fail. You have to use ".gitmodules eol=lf" to make it pass. I stopped digging deeper at this point.
Show 5 quoted lines
> I don't see any reason for each individual repo to have to add these > attributes manually. This is a git-specific file, and the format is > dictated by git. We know that it's a text file, so why not help out the > user? We should possibly do the same thing for .gitattributes and > .gitignore.
I really like this approach. (And in the long run would like to see a ini-file aware merge driver being used for the .gitmodules file too, which would just merge submodules added in different branches instead of producing a conflict)