emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Git refuses to commit files with DOS EOL


From: Eli Zaretskii
Subject: Re: Git refuses to commit files with DOS EOL
Date: Sat, 30 May 2015 21:33:03 +0300

> Date: Sat, 30 May 2015 09:35:49 -0700
> From: Paul Eggert <address@hidden>
> 
> Eli Zaretskii wrote:
> > The pre-commit hook complains about trailing whitespace in such
> > files.  I needed to use --no-verify to get past it.
> >
> > Why is it doing that?
> 
> Git keeps track of text files with CRLF vs LF endings, and autoconverts from 
> one 
> format to another when it is run on platforms that prefer one or the other.  
> It 
> also knows about binary formats, where there's no conversion.  It needs to do 
> all this stuff in order for merging to work reliably, since merging often 
> works 
> on a line-by-line basis.

I've set up Git to not perform any EOL conversions.

> To get this all to work, you sometimes have to tell Git about files that 
> don't 
> follow the ordinary rules: e.g., they are text files that should use CRLF 
> endings even on GNUish and POSIX platforms.  This is done in the 
> .gitattributes 
> file.  There's a man page for .gitattributes, as well as one for the 'git 
> check-attr' command.  The actual set of features is more complicated than 
> what 
> I've mentioned here, and the GNU Emacs .gitattributes file doesn't use all 
> the 
> features.
> 
> I patched .gitattributes to mention the CRLF-oriented files you recently 
> added 
> to the test cases.

Thanks.

So you are saying that adding a file with DOS EOLs requires such
additions to .gitattributes?

Is that because of our pre-commit hook, or is this something general
with Git?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]