{"thread":{"id":"49881","subject":"Document change in format of raw diff output format","startedAt":"2018-11-22T10:59:00Z","lastAt":"2018-11-26T07:02:28Z","messageCount":7,"participants":["Greg Hurrell","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"363879","messageId":"20181122105836.GA36193@retiro.local","threadId":"49881","inReplyTo":null,"subject":"Document change in format of raw diff output format","fromName":"Greg Hurrell","fromEmail":"greg@hurrell.net","sentAt":"2018-11-22T10:58:36Z","receivedAt":"2018-11-22T10:59:00Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"I was troubleshooting some breakage in some code that consumes the output of `git log --raw` and looking on two machines with different versions of Git just now I discovered the output format has changed somewhere between v2.14.5:\n\n:000000 100644 000000000... 9773b7718... A      content/snippets/1157.md\n\nand v2.19.0:\n\n:000000 100644 000000000 9773b7718 A    content/snippets/1157.md\n\nA quick search turns up some patches related to the GIT_PRINT_SHA1_ELLIPSIS env variable, which can be used to force the old output format, and which landed in v2.16.0, I think.\n\nDoes it sound right that we should update the documentation in diff-format.txt to show what the new output format is? The examples all show the old output format, which isn't produced by default any more.\n\nSomething like the following? If the answer is yes, I can turn it into a real patch.\n\nCheers,\nGreg\n\n\ndiff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\nindex 706916c94c..33776459d0 100644\n--- a/Documentation/diff-format.txt\n+++ b/Documentation/diff-format.txt\n@@ -26,12 +26,12 @@ line per changed file.\n An output line is formatted this way:\n\n ------------------------------------------------\n-in-place edit  :100644 100644 bcd1234... 0123456... M file0\n-copy-edit      :100644 100644 abcd123... 1234567... C68 file1 file2\n-rename-edit    :100644 100644 abcd123... 1234567... R86 file1 file3\n-create         :000000 100644 0000000... 1234567... A file4\n-delete         :100644 000000 1234567... 0000000... D file5\n-unmerged       :000000 000000 0000000... 0000000... U file6\n+in-place edit  :100644 100644 bcd123456 012345678 M file0\n+copy-edit      :100644 100644 abcd12345 123456789 C68 file1 file2\n+rename-edit    :100644 100644 abcd12345 123456789 R86 file1 file3\n+create         :000000 100644 000000000 123456789 A file4\n+delete         :100644 000000 123456789 000000000 D file5\n+unmerged       :000000 000000 000000000 000000000 U file6\n ------------------------------------------------\n\n That is, from the left to the right:\n@@ -75,7 +75,7 @@ and it is out of sync with the index.\n Example:\n\n ------------------------------------------------\n-:100644 100644 5be4a4...... 000000...... M file.c\n+:100644 100644 5be4a4abc 000000000 M file.c\n ------------------------------------------------\n\n Without the `-z` option, pathnames with \"unusual\" characters are\n@@ -100,7 +100,7 @@ from the format described above in the following way:\n Example:\n\n ------------------------------------------------\n-::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM     describe.c\n+::100644 100644 100644 fabadb827 cc95eb0f2 4866510ea MM        describe.c\n ------------------------------------------------\n\n Note that 'combined diff' lists only files which were modified from\n\n"},{"id":"363907","messageId":"20181122160154.GA28192@sigill.intra.peff.net","threadId":"49881","inReplyTo":"20181122105836.GA36193@retiro.local","subject":"Re: Document change in format of raw diff output format","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-11-22T16:01:55Z","receivedAt":"2018-11-22T16:01:59Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Nov 22, 2018 at 11:58:36AM +0100, Greg Hurrell wrote:\n\n> I was troubleshooting some breakage in some code that consumes the\n> output of `git log --raw` and looking on two machines with different\n> versions of Git just now I discovered the output format has changed\n> somewhere between v2.14.5:\n> \n> :000000 100644 000000000... 9773b7718... A      content/snippets/1157.md\n> \n> and v2.19.0:\n> \n> :000000 100644 000000000 9773b7718 A    content/snippets/1157.md\n> \n> A quick search turns up some patches related to the\n> GIT_PRINT_SHA1_ELLIPSIS env variable, which can be used to force the\n> old output format, and which landed in v2.16.0, I think.\n\nYes. The actual commit that flipped the default is 7cb6ac1e4b (diff:\ndiff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value,\n2017-12-03). There's more discussion of the possibility of breakage in\nthis subthread:\n\n  https://public-inbox.org/git/83D263E58ABD46188756D41FE311E469@PhilipOakley/\n\n> Does it sound right that we should update the documentation in\n> diff-format.txt to show what the new output format is? The examples\n> all show the old output format, which isn't produced by default any\n> more.\n\nYes, we should definitely update the documentation to show the modern\nformat. I think that was just an oversight in the original series.\n\n> diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\n> index 706916c94c..33776459d0 100644\n> --- a/Documentation/diff-format.txt\n> +++ b/Documentation/diff-format.txt\n> @@ -26,12 +26,12 @@ line per changed file.\n>  An output line is formatted this way:\n> \n>  ------------------------------------------------\n> -in-place edit  :100644 100644 bcd1234... 0123456... M file0\n> -copy-edit      :100644 100644 abcd123... 1234567... C68 file1 file2\n> -rename-edit    :100644 100644 abcd123... 1234567... R86 file1 file3\n> -create         :000000 100644 0000000... 1234567... A file4\n> -delete         :100644 000000 1234567... 0000000... D file5\n> -unmerged       :000000 000000 0000000... 0000000... U file6\n> +in-place edit  :100644 100644 bcd123456 012345678 M file0\n> +copy-edit      :100644 100644 abcd12345 123456789 C68 file1 file2\n> +rename-edit    :100644 100644 abcd12345 123456789 R86 file1 file3\n> +create         :000000 100644 000000000 123456789 A file4\n> +delete         :100644 000000 123456789 000000000 D file5\n> +unmerged       :000000 000000 000000000 000000000 U file6\n>  ------------------------------------------------\n\nYeah, this looks like an improvement.\n\nI think in general that we'd continue to show 7 characters now, just\nwithout the extra dots (though it's auto-scaled based on the number of\nobjects in the repo these days, so it's not even really a constant).\n\n>  That is, from the left to the right:\n> @@ -75,7 +75,7 @@ and it is out of sync with the index.\n>  Example:\n> \n>  ------------------------------------------------\n> -:100644 100644 5be4a4...... 000000...... M file.c\n> +:100644 100644 5be4a4abc 000000000 M file.c\n>  ------------------------------------------------\n\nI'm not even sure what this original was trying to show. I don't think\nwe ever produced that any dots. :)\n\nThanks for noticing.\n\n-Peff\n\nPS As you noticed, \"git log\" we don't promise that git-log output will\n   never change between versions. For machine-consumption you probably\n   want to use plumbing like \"git rev-list | git diff-tree --stdin\",\n   which produces unabbreviated hashes.\n"},{"id":"363956","messageId":"20181123090908.43445-1-greg@hurrell.net","threadId":"49881","inReplyTo":"20181122160154.GA28192@sigill.intra.peff.net","subject":"Document change in format of raw diff output format","fromName":"Greg Hurrell","fromEmail":"greg@hurrell.net","sentAt":"2018-11-23T09:09:07Z","receivedAt":"2018-11-23T09:09:30Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"Jeff King wrote:\n\n> On Thu, Nov 22, 2018 at 11:58:36AM +0100, Greg Hurrell wrote:\n> \n> > diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\n> > index 706916c94c..33776459d0 100644\n> > --- a/Documentation/diff-format.txt\n> > +++ b/Documentation/diff-format.txt\n> > @@ -26,12 +26,12 @@ line per changed file.\n> >  An output line is formatted this way:\n> > \n> >  ------------------------------------------------\n> > -in-place edit  :100644 100644 bcd1234... 0123456... M file0\n> > -copy-edit      :100644 100644 abcd123... 1234567... C68 file1 file2\n> > -rename-edit    :100644 100644 abcd123... 1234567... R86 file1 file3\n> > -create         :000000 100644 0000000... 1234567... A file4\n> > -delete         :100644 000000 1234567... 0000000... D file5\n> > -unmerged       :000000 000000 0000000... 0000000... U file6\n> > +in-place edit  :100644 100644 bcd123456 012345678 M file0\n> > +copy-edit      :100644 100644 abcd12345 123456789 C68 file1 file2\n> > +rename-edit    :100644 100644 abcd12345 123456789 R86 file1 file3\n> > +create         :000000 100644 000000000 123456789 A file4\n> > +delete         :100644 000000 123456789 000000000 D file5\n> > +unmerged       :000000 000000 000000000 000000000 U file6\n> >  ------------------------------------------------\n> \n> Yeah, this looks like an improvement.\n> \n> I think in general that we'd continue to show 7 characters now, just\n> without the extra dots (though it's auto-scaled based on the number of\n> objects in the repo these days, so it's not even really a constant).\n\nThat's funny. I looked at the output on (what I thought was) a small\nrepo and it was showing me 9-character abbreviated hashes. I guess I\njust got lucky. Tested on a basically empty repo and 7 does look to be\nthe default.\n\n> PS As you noticed, \"git log\" we don't promise that git-log output will\n>    never change between versions. For machine-consumption you probably\n>    want to use plumbing like \"git rev-list | git diff-tree --stdin\",\n>    which produces unabbreviated hashes.\n\nThanks for the tip. My mistake was thinking that the `--raw` made the\n`git log` output somehow more plumbing-ish, but I've gone ahead and\nswitched to using git-rev-list plus git-diff-tree instead.\n\nAnyway, patch follows.\n\n\n"},{"id":"363957","messageId":"20181123090908.43445-2-greg@hurrell.net","threadId":"49881","inReplyTo":"20181123090908.43445-1-greg@hurrell.net","subject":"[PATCH] doc: update diff-format.txt for removed ellipses","fromName":"Greg Hurrell","fromEmail":"greg@hurrell.net","sentAt":"2018-11-23T09:09:08Z","receivedAt":"2018-11-23T09:09:31Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"Commit 7cb6ac1e4b made the diff format omit ellipses by default, but\nthere is still this place in the documentation where we show examples of\noutput with ellipses.\n\nThe GIT_PRINT_SHA1_ELLIPSIS environment variable can be used, for now,\nto bring back the old output format, but that is already documented in\ngit.txt, so I am not mentioning it here.\n---\n Documentation/diff-format.txt | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\nindex 706916c94c..cdcc17f0ad 100644\n--- a/Documentation/diff-format.txt\n+++ b/Documentation/diff-format.txt\n@@ -26,12 +26,12 @@ line per changed file.\n An output line is formatted this way:\n \n ------------------------------------------------\n-in-place edit  :100644 100644 bcd1234... 0123456... M file0\n-copy-edit      :100644 100644 abcd123... 1234567... C68 file1 file2\n-rename-edit    :100644 100644 abcd123... 1234567... R86 file1 file3\n-create         :000000 100644 0000000... 1234567... A file4\n-delete         :100644 000000 1234567... 0000000... D file5\n-unmerged       :000000 000000 0000000... 0000000... U file6\n+in-place edit  :100644 100644 bcd1234 0123456 M file0\n+copy-edit      :100644 100644 abcd123 1234567 C68 file1 file2\n+rename-edit    :100644 100644 abcd123 1234567 R86 file1 file3\n+create         :000000 100644 0000000 1234567 A file4\n+delete         :100644 000000 1234567 0000000 D file5\n+unmerged       :000000 000000 0000000 0000000 U file6\n ------------------------------------------------\n \n That is, from the left to the right:\n@@ -75,7 +75,7 @@ and it is out of sync with the index.\n Example:\n \n ------------------------------------------------\n-:100644 100644 5be4a4...... 000000...... M file.c\n+:100644 100644 5be4a4a 0000000 M file.c\n ------------------------------------------------\n \n Without the `-z` option, pathnames with \"unusual\" characters are\n@@ -100,7 +100,7 @@ from the format described above in the following way:\n Example:\n \n ------------------------------------------------\n-::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM\tdescribe.c\n+::100644 100644 100644 fabadb8 cc95eb0 4866510 MM\tdescribe.c\n ------------------------------------------------\n \n Note that 'combined diff' lists only files which were modified from\n-- \n2.19.0\n\n"},{"id":"363984","messageId":"xmqqwop32npr.fsf@gitster-ct.c.googlers.com","threadId":"49881","inReplyTo":"20181123090908.43445-2-greg@hurrell.net","subject":"Re: [PATCH] doc: update diff-format.txt for removed ellipses","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-11-24T02:50:24Z","receivedAt":"2018-11-24T02:55:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks for a patch.\n\nGreg Hurrell <greg@hurrell.net> writes:\n\n> Commit 7cb6ac1e4b made the diff format omit ellipses by default, but\n> there is still this place in the documentation where we show examples of\n> output with ellipses.\n\nWe prefer to cite an existing commit with its title and date these\ndays, not just with its object name.\n\n    Since 7cb6ac1e (\"diff: diff_aligned_abbrev: remove ellipsis after\n    abbreviated SHA-1 value\", 2017-12-03), the \"--raw\" format of diff\n    does not add ellipsis in an attempt to align the output, but...\n\nor something like that.  Note that saying this is about the raw format\nis quite essential thing to tell the readers to explain this hange.\n\n> The GIT_PRINT_SHA1_ELLIPSIS environment variable can be used, for now,\n> to bring back the old output format, but that is already documented in\n> git.txt, so I am not mentioning it here.\n\nYeah, I do not think it makes sense to use the workaround that is\nplanned for removal, which will later make us revise the example in\nthe documentation again, to end up with the text that you have right\nnow.  I do not think this three-line paragraph needs to be in the\nlog message, either, though.  Perhaps below the three-dash line.\n\n\nAlso please sign-off your patch here (see\nDocumentation/SubmittingPatches).\n\n> ---\n\nThanks.\n\n>  Documentation/diff-format.txt | 16 ++++++++--------\n>  1 file changed, 8 insertions(+), 8 deletions(-)\n>\n> diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\n> index 706916c94c..cdcc17f0ad 100644\n> --- a/Documentation/diff-format.txt\n> +++ b/Documentation/diff-format.txt\n> @@ -26,12 +26,12 @@ line per changed file.\n>  An output line is formatted this way:\n>  \n>  ------------------------------------------------\n> -in-place edit  :100644 100644 bcd1234... 0123456... M file0\n> -copy-edit      :100644 100644 abcd123... 1234567... C68 file1 file2\n> -rename-edit    :100644 100644 abcd123... 1234567... R86 file1 file3\n> -create         :000000 100644 0000000... 1234567... A file4\n> -delete         :100644 000000 1234567... 0000000... D file5\n> -unmerged       :000000 000000 0000000... 0000000... U file6\n> +in-place edit  :100644 100644 bcd1234 0123456 M file0\n> +copy-edit      :100644 100644 abcd123 1234567 C68 file1 file2\n> +rename-edit    :100644 100644 abcd123 1234567 R86 file1 file3\n> +create         :000000 100644 0000000 1234567 A file4\n> +delete         :100644 000000 1234567 0000000 D file5\n> +unmerged       :000000 000000 0000000 0000000 U file6\n>  ------------------------------------------------\n>  \n>  That is, from the left to the right:\n> @@ -75,7 +75,7 @@ and it is out of sync with the index.\n>  Example:\n>  \n>  ------------------------------------------------\n> -:100644 100644 5be4a4...... 000000...... M file.c\n> +:100644 100644 5be4a4a 0000000 M file.c\n>  ------------------------------------------------\n>  \n>  Without the `-z` option, pathnames with \"unusual\" characters are\n> @@ -100,7 +100,7 @@ from the format described above in the following way:\n>  Example:\n>  \n>  ------------------------------------------------\n> -::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM\tdescribe.c\n> +::100644 100644 100644 fabadb8 cc95eb0 4866510 MM\tdescribe.c\n>  ------------------------------------------------\n>  \n>  Note that 'combined diff' lists only files which were modified from\n"},{"id":"363995","messageId":"20181124092958.3549-1-greg@hurrell.net","threadId":"49881","inReplyTo":"xmqqwop32npr.fsf@gitster-ct.c.googlers.com","subject":"[PATCH] doc: update diff-format.txt for removed ellipses in --raw","fromName":"Greg Hurrell","fromEmail":"greg@hurrell.net","sentAt":"2018-11-24T09:29:58Z","receivedAt":"2018-11-24T09:30:44Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"Since 7cb6ac1e4b (\"diff: diff_aligned_abbrev: remove ellipsis after\nabbreviated SHA-1 value\", 2017-12-03), the \"--raw\" format of diff\ndoes not add ellipses in an attempt to align the output, but the\ndocumentation was not updated to reflect this.\n\nSigned-off-by: Greg Hurrell <greg@hurrell.net>\n---\n\nThe GIT_PRINT_SHA1_ELLIPSIS environment variable can be used, for now,\nto bring back the old output format, but that is already documented in\ngit.txt, so I am not mentioning it here.\n\n Documentation/diff-format.txt | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\nindex 706916c94c..cdcc17f0ad 100644\n--- a/Documentation/diff-format.txt\n+++ b/Documentation/diff-format.txt\n@@ -26,12 +26,12 @@ line per changed file.\n An output line is formatted this way:\n \n ------------------------------------------------\n-in-place edit  :100644 100644 bcd1234... 0123456... M file0\n-copy-edit      :100644 100644 abcd123... 1234567... C68 file1 file2\n-rename-edit    :100644 100644 abcd123... 1234567... R86 file1 file3\n-create         :000000 100644 0000000... 1234567... A file4\n-delete         :100644 000000 1234567... 0000000... D file5\n-unmerged       :000000 000000 0000000... 0000000... U file6\n+in-place edit  :100644 100644 bcd1234 0123456 M file0\n+copy-edit      :100644 100644 abcd123 1234567 C68 file1 file2\n+rename-edit    :100644 100644 abcd123 1234567 R86 file1 file3\n+create         :000000 100644 0000000 1234567 A file4\n+delete         :100644 000000 1234567 0000000 D file5\n+unmerged       :000000 000000 0000000 0000000 U file6\n ------------------------------------------------\n \n That is, from the left to the right:\n@@ -75,7 +75,7 @@ and it is out of sync with the index.\n Example:\n \n ------------------------------------------------\n-:100644 100644 5be4a4...... 000000...... M file.c\n+:100644 100644 5be4a4a 0000000 M file.c\n ------------------------------------------------\n \n Without the `-z` option, pathnames with \"unusual\" characters are\n@@ -100,7 +100,7 @@ from the format described above in the following way:\n Example:\n \n ------------------------------------------------\n-::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM\tdescribe.c\n+::100644 100644 100644 fabadb8 cc95eb0 4866510 MM\tdescribe.c\n ------------------------------------------------\n \n Note that 'combined diff' lists only files which were modified from\n-- \n2.19.0\n\n"},{"id":"364064","messageId":"xmqqzhtwwccg.fsf@gitster-ct.c.googlers.com","threadId":"49881","inReplyTo":"20181124092958.3549-1-greg@hurrell.net","subject":"Re: [PATCH] doc: update diff-format.txt for removed ellipses in --raw","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-11-26T07:02:23Z","receivedAt":"2018-11-26T07:02:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Greg Hurrell <greg@hurrell.net> writes:\n\n> Since 7cb6ac1e4b (\"diff: diff_aligned_abbrev: remove ellipsis after\n> abbreviated SHA-1 value\", 2017-12-03), the \"--raw\" format of diff\n> does not add ellipses in an attempt to align the output, but the\n> documentation was not updated to reflect this.\n>\n> Signed-off-by: Greg Hurrell <greg@hurrell.net>\n> ---\n>\n> The GIT_PRINT_SHA1_ELLIPSIS environment variable can be used, for now,\n> to bring back the old output format, but that is already documented in\n> git.txt, so I am not mentioning it here.\n\nThanks. Will queue.\n"}]}