{"thread":{"id":"5322","subject":"git diff - no newline after @@ ?","startedAt":"2006-08-18T12:10:42Z","lastAt":"2006-08-18T13:42:55Z","messageCount":7,"participants":["Petr Sebor","Alex Riesen","Jakub Narebski","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"25546","messageId":"44E5AE42.6090506@scssoft.com","threadId":"5322","inReplyTo":null,"subject":"git diff - no newline after @@ ?","fromName":"Petr Sebor","fromEmail":"petr@scssoft.com","sentAt":"2006-08-18T12:10:42Z","receivedAt":"2006-08-18T12:10:42Z","isPatch":false,"sender":{"key":"petr@scssoft.com","avatar":null},"body":"Hello,\n\nhas anyone noticed that the 'git diff' output somehow lacks the newline \nafter the @@ tag?\n\nThe linux-kernel list is full of diffs whose hunks begin like:\n\n@@ -1475,6 +1475,7 @@ int do_coredump(long signr, int exit_cod\n\n@@ -1516,22 +1517,34 @@ int do_coredump(long signr, int exit_cod\n\n@@ -1428,7 +1442,7 @@ static int elf_core_dump(long signr, str\n\ninstead of:\n\n@@ -1475,6 +1475,7 @@\n int do_coredump(long signr, int exit_cod\n\n@@ -1516,22 +1517,34 @@\n int do_coredump(long signr, int exit_cod\n\n@@ -1428,7 +1442,7 @@\n static int elf_core_dump(long signr, str\n\n\nIt is not only a problem of the linux-kernel, my local git installation \nsuffers from this as well...\n\nRegards\nPetr\n"},{"id":"25547","messageId":"81b0412b0608180525t284d3124j867a9461bf14ed91@mail.gmail.com","threadId":"5322","inReplyTo":"44E5AE42.6090506@scssoft.com","subject":"Re: git diff - no newline after @@ ?","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-08-18T12:25:00Z","receivedAt":"2006-08-18T12:25:00Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 8/18/06, Petr Sebor <petr@scssoft.com> wrote:\n> Hello,\n>\n> has anyone noticed that the 'git diff' output somehow lacks the newline\n> after the @@ tag?\n>\n\nWhy should it? It's hunk comment.\n"},{"id":"25549","messageId":"44E5B496.3070901@scssoft.com","threadId":"5322","inReplyTo":"81b0412b0608180525t284d3124j867a9461bf14ed91@mail.gmail.com","subject":"Re: git diff - no newline after @@ ?","fromName":"Petr Sebor","fromEmail":"petr@scssoft.com","sentAt":"2006-08-18T12:37:42Z","receivedAt":"2006-08-18T12:37:42Z","isPatch":false,"sender":{"key":"petr@scssoft.com","avatar":null},"body":"Alex Riesen wrote:\n> On 8/18/06, Petr Sebor <petr@scssoft.com> wrote:\n>> Hello,\n>>\n>> has anyone noticed that the 'git diff' output somehow lacks the newline\n>> after the @@ tag?\n>>\n>\n> Why should it? It's hunk comment.\nHunk comment? Maybe we don't understand each other...\n\ncheck another example:\n\n--- a/include/linux/kernel.h\n+++ b/include/linux/kernel.h\n@@ -13,6 +13,7 @@ #include <linux/stddef.h>\n #include <linux/types.h>\n #include <linux/compiler.h>\n #include <linux/bitops.h>\n+#include <linux/memleak.h>\n #include <asm/byteorder.h>\n #include <asm/bug.h>\n\nwhereas gnu diff would output\n\n--- a/include/linux/kernel.h\n+++ b/include/linux/kernel.h\n@@ -13,6 +13,7 @@\n #include <linux/stddef.h>\n #include <linux/types.h>\n #include <linux/compiler.h>\n #include <linux/bitops.h>\n+#include <linux/memleak.h>\n #include <asm/byteorder.h>\n #include <asm/bug.h>\n\nPetr\n"},{"id":"25550","messageId":"ec4cfi$9dn$1@sea.gmane.org","threadId":"5322","inReplyTo":"44E5B496.3070901@scssoft.com","subject":"Re: git diff - no newline after @@ ?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-18T12:40:17Z","receivedAt":"2006-08-18T12:40:17Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Petr Sebor wrote:\n\n> Alex Riesen wrote:\n>> On 8/18/06, Petr Sebor <petr@scssoft.com> wrote:\n>>> Hello,\n>>>\n>>> has anyone noticed that the 'git diff' output somehow lacks the newline\n>>> after the @@ tag?\n>>>\n>>\n>> Why should it? It's hunk comment.\n> Hunk comment? Maybe we don't understand each other...\n\nHunk comment as in \"diff -p\":\n\n  -p     Show which C function each change is in.\n\n(which is simpliefied to: show first line preceding hunk which begins with\nword character in first column). \n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"25551","messageId":"20060818124428.GA22328@sigio.intra.peff.net","threadId":"5322","inReplyTo":"44E5B496.3070901@scssoft.com","subject":"Re: git diff - no newline after @@ ?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-08-18T12:44:28Z","receivedAt":"2006-08-18T12:44:28Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Aug 18, 2006 at 02:37:42PM +0200, Petr Sebor wrote:\n\n> >>has anyone noticed that the 'git diff' output somehow lacks the newline\n> >>after the @@ tag?\n> >Why should it? It's hunk comment.\n> Hunk comment? Maybe we don't understand each other...\n\nThe intent of a hunk comment is to give the user some context. Note how\nit's usually the C function name, even if the declaration of that\nfunction isn't the line right before the context lines?\n\n> check another example:\n> \n> --- a/include/linux/kernel.h\n> +++ b/include/linux/kernel.h\n> @@ -13,6 +13,7 @@ #include <linux/stddef.h>\n> #include <linux/types.h>\n> #include <linux/compiler.h>\n> #include <linux/bitops.h>\n> +#include <linux/memleak.h>\n> #include <asm/byteorder.h>\n> #include <asm/bug.h>\n\nThe function detection is very simple (I believe it just looks for the\nclosest preceding line without any prior whitespace).\n\n> whereas gnu diff would output\n\nTry diff -p to get a hunk comment.\n\n-Peff\n"},{"id":"25555","messageId":"44E5BE60.5010901@scssoft.com","threadId":"5322","inReplyTo":"20060818124428.GA22328@sigio.intra.peff.net","subject":"Re: git diff - no newline after @@ ?","fromName":"Petr Sebor","fromEmail":"petr@scssoft.com","sentAt":"2006-08-18T13:19:28Z","receivedAt":"2006-08-18T13:19:28Z","isPatch":false,"sender":{"key":"petr@scssoft.com","avatar":null},"body":"Jeff King wrote:\n> Try diff -p to get a hunk comment.\n>\n> -Peff\n>   \n\nOuch.... got it. Is there a way to turn the comment generation off btw?\n\nSorry for the noise...\n\nPetr\n"},{"id":"25557","messageId":"ec4g4v$m4v$1@sea.gmane.org","threadId":"5322","inReplyTo":"44E5BE60.5010901@scssoft.com","subject":"Re: git diff - no newline after @@ ?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-18T13:42:55Z","receivedAt":"2006-08-18T13:42:55Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Petr Sebor wrote:\n\n> Jeff King wrote:\n>> Try diff -p to get a hunk comment.\n>>\n>> -Peff\n>>   \n> \n> Ouch.... got it. Is there a way to turn the comment generation off btw?\n\nOther than GIT_DIFF_OPTS (although how to turn off present -p option), or\nGIT_EXTERNAL_DIFF (see git-diff-tree(1))?\n\nWhy do you want to turn it off? patch understands this format...\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}