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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: hasen j
Date: Friday, May 7, 2010 - 3:54 pm

> Part of the confusion comes from the way the options are currently

If we forget everything git has now, I would suggest the following:

- eol-normalization is per repository, per filetype (fnmatch filter)
- in a file separate from .git/config, such as .git/eol
- when you clone, you get this file

You specifies the 'standard' eol type for each file type in this project:

    *.c lf
    *.python lf
    *.vb crlf
    *.sln crlf
    etc (something like that)

committing and checking-out always normalize line endings; *always*

add (and commit) can take an option to keep eol as-is (i.e.
--no-eol-normalization or --keep-eol or --raw-eol)

In this model:

1- Anyone who clones gets the repository eol settings
2- No one can possibly commit in a different eol style unless he
explicitly says he wants to.
3- Naturally, eol-normalization doesn't apply to binary files

#2 is important, it's needed so you won't have someone making bad
commits because he has a settings some where in his global config to
always ignore eol normalization.
on the other hand, one can alias 'add --raw-eol' to something like
'eviladd', so he can do 'git eviladd file.c', which is fine because
it's explicit.

This would get rid of issues where an editor (such as VS) saves a file
with mixed line endings: we don't care because we normalize them.

This would also make it more transparent to windows users: they don't
even have to think about eol issues; they can't make bad commits
"by-accident". (provided the repo maintainer has set the eol filters
properly).

I have no idea what happens (or should happen) if the origin repo
maintainer updates the .git/eol file. Maybe it should be .giteol
instead of .git/eol
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: What should be the CRLF policy when win + Linux?, Ramkumar Ramachandra, (Wed May 5, 6:27 am)
Re: What should be the CRLF policy when win + Linux?, Wilbert van Dolleweerd, (Thu May 6, 12:29 am)
Re: What should be the CRLF policy when win + Linux?, Erik Faye-Lund, (Thu May 6, 3:03 am)
Re: What should be the CRLF policy when win + Linux?, Linus Torvalds, (Thu May 6, 10:15 am)
Re: What should be the CRLF policy when win + Linux?, Erik Faye-Lund, (Thu May 6, 10:26 am)
Re: What should be the CRLF policy when win + Linux?, Linus Torvalds, (Thu May 6, 1:23 pm)
Re: What should be the CRLF policy when win + Linux?, Erik Faye-Lund, (Thu May 6, 1:40 pm)
[PATCH/RFC 0/3] Per-repository end-of-line normalization, Eyvind Bernhardsen, (Thu May 6, 3:27 pm)
[PATCH/RFC 2/3] Add tests for per-repository eol normalization, Eyvind Bernhardsen, (Thu May 6, 3:27 pm)
[PATCH/RFC 3/3] Add per-repository eol normalization, Eyvind Bernhardsen, (Thu May 6, 3:27 pm)
Re: What should be the CRLF policy when win + Linux?, Erik Faye-Lund, (Thu May 6, 4:25 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, Eyvind Bernhardsen, (Fri May 7, 12:23 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, Eyvind Bernhardsen, (Fri May 7, 12:25 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, Finn Arne Gangstad, (Fri May 7, 12:41 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, Eyvind Bernhardsen, (Fri May 7, 1:11 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, Eyvind Bernhardsen, (Fri May 7, 1:42 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, Eyvind Bernhardsen, (Fri May 7, 2:17 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, Eyvind Bernhardsen, (Fri May 7, 2:37 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, A Large Angry SCM, (Fri May 7, 3:09 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, hasen j, (Fri May 7, 3:54 pm)
Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization, Eyvind Bernhardsen, (Sun May 9, 12:49 am)
Re: What should be the CRLF policy when win + Linux?, Anthony W. Youngman, (Tue May 18, 8:13 am)