From: Avery Pennarun <apenwarr@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>,
git@vger.kernel.org, hasan.aljudy@gmail.com,
kusmabite@googlemail.com, torvalds@linux-foundation.org,
prohaska@zib.de
Subject: Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization
Date: Fri, 7 May 2010 12:57:12 -0400 [thread overview]
Message-ID: <v2q32541b131005070957j819890dbqe613985ff5f65b84@mail.gmail.com> (raw)
In-Reply-To: <7v4oijhdsi.fsf@alter.siamese.dyndns.org>
On Fri, May 7, 2010 at 12:33 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com> writes:
>> - An attribute called "auto-eol" is set in the repository to turn on
>> normalization of line endings. Since attributes are content, the
>> setting is copied when the repository is cloned and can be changed in
>> an existing repository (with a few caveats). Setting this attribute
>> is equivalent to setting "core.autocrlf" to "input" or "true".
>
> In what way is this attribute different from existing "crlf" attribute?
Mostly that it relates to the new core.eolStyle config option instead
of core.autocrlf. Arguably you could use the same gitattribute to set
both config options, but I don't know how you'd make that respond in a
sane backwards-compatible fashion.
> It feels as if this series is fixing shortcomings of the combination of
> core.autocrlf configuration and crlf attribute while trying very hard to
> keep their shortcomings when the user doesn't say so. What is the
> downside of making the existing "core.autocrlf" + "crlf" combination do
> what your patch wanted to do without retaining this "keep the existing
> shortcomings for backward compatibility"?
Is this even possible? If core.autocrlf is set, then files all over
the place start getting crlf conversion, even if no attributes are set
at all. If core.eolStyle is set, only files with the auto-eol
attribute set appropriately will experience any conversion.
Maybe the options aren't named ideally. "core.eolStyle" might better
be named "core.nativeEol" - it tells git what the native EOL style is
on your computer / in this repository, but it doesn't tell git to *do*
anything with this information. The problem with core.autocrlf is
that it mixes two concepts: identifying your native EOL style, and
telling git to do stuff. The existing gitattribute can then tell git
*not* to do stuff, but almost no projects have a .gitattributes file
that does this.
>> 1. Setting core.autocrlf in your global or system configuration is a
>> pain
>
> This is a wrong thing to do to begin with, and not worth discussing.
Ha, doesn't msysgit do this by default? It did at one point, anyway.
I use cygwin git (which doesn't because it thinks it's Unix) so I
don't know.
If this was ever the default behaviour, then it's at least not
*obviously* wrong.
The end result is that nobody really likes the current autocrlf
behaviour, though, so I'd agree that it *ends up* being wrong. Just
as setting it on a per-checkout basis also ends up being wrong,
because it's so easy to forget.
> You
> know and your readers know that line ending convention in the repository
> data (i.e. blobs) is under project control while line ending convention in
> the working tree is end user preference.
Yes. But the current system doesn't make it very easy to state your preference.
>> 2. Setting core.autocrlf in an individual repository would be okay
>> except that naive users will do it after they have already cloned:
>> unless core.autocrlf is set globally, the clone will have the wrong line
>> endings, and the user needs to know how to refresh it manually (rm -rf *
>> && git checkout -f).
>
> This may be a worthy goal. But if a "auto-eol" attribute "fixes" this,
> perhaps "crlf" attribute can be taught to fix it the same way, no?
It fixes it by making the global setting actually do what people want.
I'm not sure the existing config option can be made to work like
that.
Again, maybe it would make sense to combine a single attribute but
have two config options (and people can eventually just stop using
core.autocrlf altogether). I suspect it might subtly break some
existing projects, though.
Have fun,
Avery
next prev parent reply other threads:[~2010-05-07 16:57 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 10:01 What should be the CRLF policy when win + Linux? mat
2010-05-05 13:27 ` Ramkumar Ramachandra
2010-05-06 9:27 ` mat
2010-05-06 10:03 ` Erik Faye-Lund
2010-05-06 2:35 ` hasen j
2010-05-06 7:29 ` Wilbert van Dolleweerd
2010-05-06 15:34 ` hasen j
2010-05-06 17:15 ` Linus Torvalds
2010-05-06 17:26 ` Erik Faye-Lund
2010-05-06 20:00 ` hasen j
2010-05-06 20:23 ` Linus Torvalds
2010-05-06 20:40 ` Erik Faye-Lund
2010-05-06 22:14 ` hasen j
2010-05-06 23:25 ` Erik Faye-Lund
2010-05-18 15:13 ` Anthony W. Youngman
2010-05-06 22:27 ` [PATCH/RFC 0/3] Per-repository end-of-line normalization Eyvind Bernhardsen
2010-05-06 22:27 ` [PATCH/RFC 1/3] Add "auto-eol" attribute and "core.eolStyle" config variable Eyvind Bernhardsen
2010-05-06 22:27 ` [PATCH/RFC 2/3] Add tests for per-repository eol normalization Eyvind Bernhardsen
2010-05-06 22:27 ` [PATCH/RFC 3/3] Add " Eyvind Bernhardsen
2010-05-06 23:38 ` [PATCH/RFC 0/3] Per-repository end-of-line normalization Avery Pennarun
2010-05-06 23:54 ` Avery Pennarun
2010-05-07 8:45 ` Erik Faye-Lund
2010-05-07 16:33 ` Junio C Hamano
2010-05-07 16:57 ` Avery Pennarun [this message]
2010-05-07 17:10 ` Linus Torvalds
2010-05-07 19:02 ` Linus Torvalds
2010-05-07 19:11 ` Avery Pennarun
2010-05-07 19:16 ` Linus Torvalds
2010-05-07 19:35 ` Avery Pennarun
2010-05-07 19:45 ` Linus Torvalds
2010-05-07 19:58 ` Avery Pennarun
2010-05-07 20:06 ` Linus Torvalds
2010-05-07 20:17 ` Linus Torvalds
2010-05-07 20:42 ` Eyvind Bernhardsen
2010-05-07 20:57 ` Linus Torvalds
2010-05-07 21:17 ` Eyvind Bernhardsen
2010-05-07 21:23 ` Linus Torvalds
2010-05-07 21:30 ` Avery Pennarun
2010-05-07 21:37 ` Eyvind Bernhardsen
2010-05-07 21:58 ` Linus Torvalds
2010-05-07 21:54 ` Linus Torvalds
2010-05-07 22:14 ` Linus Torvalds
2010-05-07 22:34 ` Avery Pennarun
2010-05-07 22:54 ` hasen j
2010-05-07 23:18 ` Linus Torvalds
2010-05-07 23:47 ` hasen j
2010-05-07 23:50 ` Linus Torvalds
2010-05-08 0:19 ` hasen j
2010-05-08 0:33 ` Linus Torvalds
2010-05-08 1:39 ` hasen j
2010-05-08 1:49 ` Linus Torvalds
2010-05-08 2:49 ` hasen j
2010-05-08 3:31 ` Robert Buck
2010-05-08 3:45 ` Avery Pennarun
2010-05-08 10:36 ` hasen j
2010-05-08 11:36 ` Robert Buck
2010-05-08 3:34 ` Avery Pennarun
2010-05-08 0:31 ` Avery Pennarun
2010-05-07 22:19 ` Avery Pennarun
2010-05-08 20:49 ` Dmitry Potapov
2010-05-08 21:54 ` Linus Torvalds
2010-05-08 23:42 ` Dmitry Potapov
2010-05-09 7:49 ` Eyvind Bernhardsen
2010-05-09 10:35 ` Robert Buck
2010-05-07 20:58 ` Avery Pennarun
2010-05-07 19:23 ` Eyvind Bernhardsen
2010-05-07 19:31 ` Nicolas Pitre
2010-05-07 19:36 ` Avery Pennarun
2010-05-07 20:29 ` Nicolas Pitre
2010-05-07 21:00 ` Avery Pennarun
2010-05-07 21:12 ` Nicolas Pitre
2010-05-07 21:26 ` Avery Pennarun
2010-05-07 22:09 ` A Large Angry SCM
2010-05-07 22:10 ` Avery Pennarun
2010-05-07 19:40 ` Linus Torvalds
2010-05-07 20:32 ` Nicolas Pitre
2010-05-07 19:06 ` Junio C Hamano
2010-05-07 19:25 ` Eyvind Bernhardsen
2010-05-07 19:41 ` Finn Arne Gangstad
2010-05-07 20:06 ` Avery Pennarun
2010-05-07 20:11 ` Eyvind Bernhardsen
2010-05-07 7:15 ` What should be the CRLF policy when win + Linux? Gelonida
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=v2q32541b131005070957j819890dbqe613985ff5f65b84@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=eyvind.bernhardsen@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hasan.aljudy@gmail.com \
--cc=kusmabite@googlemail.com \
--cc=prohaska@zib.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).