Thread (58 messages) 58 messages, 11 authors, 2016-06-15

Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization

flat view

From: Finn Arne Gangstad <hidden>
Date: 2016-06-15 22:48:46

On Fri, May 07, 2010 at 09:33:49AM -0700, Junio C Hamano wrote:
Eyvind Bernhardsen [off-list ref] writes:
quoted
- 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?
The crlf attribute says whether to enable autocrlf functionality for a
file, but that is not what is really wanted. auto-eol instead says how
line endings should be stored in the repository. Also, auto-eol will
only affect files auto-detected as text (or forced to be treated as
text by the crlf attribute) it seems.
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?
Maybe it is sufficient to add a new value to "crlf" that means:

- If the file is autodetected as text:
  - Convert to LF only on commit, and
  - Convert to your preferred EOL style on checkout.

I don't think autocrlf is a good place to specify preferred EOL
style, it is too dangerous to set autocrlf to true by default, but it should
not be dangerous to say that your preferred EOL style is CRLF.

- Finn Arne
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help