git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* diff --check is stupid about blank lines
@ 2008-08-20 14:05 Björn Steinbrink
  2008-08-20 17:28 ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Björn Steinbrink @ 2008-08-20 14:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

diff --check triggers not only for blank lines at the end of the file,
but also at the end of the changes. That seems broken to me, unless you
really dislike empty lines.

For example:
git (master) $ git diff
diff --git a/git.c b/git.c
index 37b1d76..3fa1aeb 100644
--- a/git.c
+++ b/git.c
@@ -9,6 +9,8 @@ const char git_usage_string[] =
 const char git_more_info_string[] =
        "See 'git help COMMAND' for more information on a specific command.";
 
+int new_var = 0;
+
 static int use_pager = -1;
 struct pager_config {
        const char *cmd;

git (master) $ git diff --check
git.c:13: ends with blank lines.

But that blank line was of course intentional.

I'm not quite sure why that happens though. The code in
checkdiff_consume seems to reset the flag when it sees context lines,
but apparently that does not work for some reason.

git version 1.6.0.36.g3814c

Björn

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

end of thread, other threads:[~2008-08-20 22:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-20 14:05 diff --check is stupid about blank lines Björn Steinbrink
2008-08-20 17:28 ` Jeff King
2008-08-20 18:13   ` Junio C Hamano
2008-08-20 18:42     ` Junio C Hamano
2008-08-20 20:02       ` Björn Steinbrink
2008-08-20 22:20       ` Jeff King
2008-08-20 22:39         ` 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).