Re: [PATCH] Respect crlf attribute even if core.autocrlf has not been set
- From
Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no>
- Date
- Jul 23, 2008, 19:20 UTC
- Message-ID
- <FB7ABDC5-8505-4FD1-8082-9BB5013E73C6@orakel.ntnu.no>
- In-Reply-To
- <alpine.DEB.1.00.0807231956280.8986@racer>
On 23. juli. 2008, at 20.57, Johannes Schindelin wrote:
Show 12 quoted lines
> Hi, > > On Wed, 23 Jul 2008, Avery Pennarun wrote: > >> 1. always CRLF on all platforms (eg. for .bat files) >> 2. always LF on all platforms (eg. for shell scripts and perl >> scripts) >> 3. just leave it alone no matter what (eg. for binary files) > > These are not different, but equal. "Do no harm to the contents of > this > file".
That is only true until someone edits the file in an editor which prefers the wrong end-of-line marker, and converts to it when saving. It will be obvious that this has happened if the user does a "git diff" before committing, but I think the intent of nos. 1 and 2 is for git to automatically convert the line endings back instead of kicking up a fuss.
Might be too magical, though.
Eyvind Bernhardsen