From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Git refuses to commit files with DOS EOL Date: Sat, 30 May 2015 21:33:03 +0300 Message-ID: <836179vrts.fsf@gnu.org> References: <83pp5iuxry.fsf@gnu.org> <5569E6E5.4050205@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1433010815 28602 80.91.229.3 (30 May 2015 18:33:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 May 2015 18:33:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 30 20:33:23 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YylZS-00068s-CN for ged-emacs-devel@m.gmane.org; Sat, 30 May 2015 20:33:22 +0200 Original-Received: from localhost ([::1]:40205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YylZR-0006tu-T0 for ged-emacs-devel@m.gmane.org; Sat, 30 May 2015 14:33:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YylZG-0006td-QM for emacs-devel@gnu.org; Sat, 30 May 2015 14:33:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YylZB-0008Pv-Qt for emacs-devel@gnu.org; Sat, 30 May 2015 14:33:10 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:60186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YylZB-0008Pl-Jh for emacs-devel@gnu.org; Sat, 30 May 2015 14:33:05 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NP600C00E2R9N00@mtaout28.012.net.il> for emacs-devel@gnu.org; Sat, 30 May 2015 21:32:22 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NP6003ROE5YIH80@mtaout28.012.net.il>; Sat, 30 May 2015 21:32:22 +0300 (IDT) In-reply-to: <5569E6E5.4050205@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186955 Archived-At: > Date: Sat, 30 May 2015 09:35:49 -0700 > From: Paul Eggert > > 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?