git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git diff --check always shows line 1 for blank at EOF for new files
@ 2010-10-06  9:27 Christoph Mallon
  2010-10-07  9:32 ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Mallon @ 2010-10-06  9:27 UTC (permalink / raw)
  To: git

Hi,

there seems to be a glitch in git diff --check for new files: If a new 
file has trailing empty lines, then the error message always refers to 
line 1. This happens with git 1.7.3.1.

Here is a simple test case:
   git init test
   cd test
   printf 'a\nb\nc\n\n' > file
   git add -AN
   git diff --check

The last command will show "file:1: new blank line at EOF.".

It works fine, if the diff is not against /dev/null, e.g.:
   git init test
   cd test
   printf 'a\nb\nc\n' > file
   git add -A
   echo >> file
   git diff --check

This correctly shows "file:4: new blank line at EOF.".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-10 10:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-06  9:27 git diff --check always shows line 1 for blank at EOF for new files Christoph Mallon
2010-10-07  9:32 ` Jonathan Nieder
2010-10-07 12:33   ` Christoph Mallon
2010-10-10 10:46     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).