All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Mallon <christoph.mallon@gmx.de>
To: git@vger.kernel.org
Subject: git diff --check always shows line 1 for blank at EOF for new files
Date: Wed, 06 Oct 2010 11:27:58 +0200	[thread overview]
Message-ID: <4CAC411E.3010204@gmx.de> (raw)

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.".

             reply	other threads:[~2010-10-06  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06  9:27 Christoph Mallon [this message]
2010-10-07  9:32 ` git diff --check always shows line 1 for blank at EOF for new files Jonathan Nieder
2010-10-07 12:33   ` Christoph Mallon
2010-10-10 10:46     ` Junio C Hamano

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=4CAC411E.3010204@gmx.de \
    --to=christoph.mallon@gmx.de \
    --cc=git@vger.kernel.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.
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.