From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Git refuses to commit files with DOS EOL
Date: Sat, 30 May 2015 21:33:03 +0300 [thread overview]
Message-ID: <836179vrts.fsf@gnu.org> (raw)
In-Reply-To: <5569E6E5.4050205@cs.ucla.edu>
> Date: Sat, 30 May 2015 09:35:49 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
>
> 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?
next prev parent reply other threads:[~2015-05-30 18:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-30 11:09 Git refuses to commit files with DOS EOL Eli Zaretskii
2015-05-30 16:35 ` Paul Eggert
2015-05-30 18:33 ` Eli Zaretskii [this message]
2015-05-30 18:52 ` Paul Eggert
2015-05-30 19:24 ` Eli Zaretskii
2015-05-30 19:40 ` Paul Eggert
2015-05-31 14:27 ` Eli Zaretskii
2015-05-31 19:54 ` Paul Eggert
2015-06-01 15:03 ` Eli Zaretskii
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=836179vrts.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.