diff --check is stupid about blank lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux