Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization
- From
Avery Pennarun <apenwarr@gmail.com>
- Date
- May 7, 2010, 19:58 UTC
- Message-ID
- <g2s32541b131005071258s92e058bakc8f3a4df1e1dc634@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.2.00.1005071240590.901@i5.linux-foundation.org>
On Fri, May 7, 2010 at 3:45 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 10 quoted lines
> On Fri, 7 May 2010, Avery Pennarun wrote: >> 1) Whether a project has files that should be EOL-converted >> automatically (we seem to all agree that this is set in >> .gitattributes, whichever attribute is used). >> >> 2) Whether a particular person wants those particular files to be >> EOL-converted, and what to convert them to. > > So? If we were to have a .gitconfig file, then both of those things would > just work.
No! The whole point is that each user *does* still want to be able to decide how to convert the files tagged by the crlf gitattribute (or a new attribute, I don't care). Setting this in a .gitconfig file inside the project is pointless; I need it in my *personal* config. msysgit users want to set it globally to CRLF by default, Linux or cygwin users probably want to set it to LF by default.
So #1 is useful to have in the repo, #2 is not.
I am a real live example of this. For our Delphi projects at work, I want to check it out with LF on my Linux machine (so I can patch/diff/merge/grep/edit/etc easily), and CRLF on my Windows machine (so that the Delphi IDE doesn't get confused). Other projects I want to have pure LF on both Linux and Windows, so setting core.autocrlf=true globally will break things.
Eyvind's proposal (or a similar proposal where his new attribute is just the crlf attribute) will get me and all my co-workers the wonderful correct behaviour *by default*; the current behaviour, or an in-repo .gitconfig, will not. The key feature is the new core.eolStyle option, not whether or not we add a new attribute.
> That said, I don't think the extra .gitconfig is even worth it, the same > way I do _not_ think Eyvind's extra .gitattributes things are worth it.
Do you even use any CRLF projects? If not, then presumably none of the options will seem worth it. :)
But the current behaviour really doesn't work for people who need CRLF conversion, and an in-repo .gitconfig file won't help them. core.eolStyle + a change to crlf attribute semantics will.
Have fun,
Avery