{"thread":{"id":"39915","subject":"[PATCH] diff-tree: do not show the sha1 of the given head with --quiet","startedAt":"2015-07-22T09:29:42Z","lastAt":"2015-07-24T06:56:01Z","messageCount":14,"participants":["Sebastian Schuberth","Johannes Schindelin","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"266602","messageId":"0000014eb518dc87-a69705c4-31e7-4983-99a8-f780a743aeac-000000@eu-west-1.amazonses.com","threadId":"39915","inReplyTo":null,"subject":"[PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-07-22T09:29:42Z","receivedAt":"2015-07-22T09:29:42Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"\"--quite\" is documented to \"Disable all output of the program\". Yet\ncalling diff-tree with a single commit like\n\n$ git diff-tree --quiet c925fe2\n\nwas logging\n\nc925fe23684455735c3bb1903803643a24a58d8f\n\nto the console despite \"--quite\" being given. This is inconsistent with\nboth the docs and the behavior if more than a single commit is passed to\ndiff-tree. Moreover, the output of that single line seems to be documented\nnowhere except in a comment for a test. Fix this inconsistency by making\ndiff-tree really output nothing if \"--quiet\" is given and fix the test\naccordingly.\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n log-tree.c            | 3 ++-\n t/t4035-diff-quiet.sh | 3 +--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/log-tree.c b/log-tree.c\nindex 01beb11..3c98234 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -741,7 +741,8 @@ int log_tree_diff_flush(struct rev_info *opt)\n \t}\n \n \tif (opt->loginfo && !opt->no_commit_id) {\n-\t\tshow_log(opt);\n+\t\tif (!DIFF_OPT_TST(&opt->diffopt, QUICK))\n+\t\t\tshow_log(opt);\n \t\tif ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) &&\n \t\t    opt->verbose_header &&\n \t\t    opt->commit_format != CMIT_FMT_ONELINE &&\ndiff --git a/t/t4035-diff-quiet.sh b/t/t4035-diff-quiet.sh\nindex 461f4bb..9a8225f 100755\n--- a/t/t4035-diff-quiet.sh\n+++ b/t/t4035-diff-quiet.sh\n@@ -40,11 +40,10 @@ test_expect_success 'git diff-tree HEAD^ HEAD -- b' '\n \ttest_expect_code 1 git diff-tree --quiet HEAD^ HEAD -- b >cnt &&\n \ttest_line_count = 0 cnt\n '\n-# this diff outputs one line: sha1 of the given head\n test_expect_success 'echo HEAD | git diff-tree --stdin' '\n \techo $(git rev-parse HEAD) |\n \ttest_expect_code 1 git diff-tree --quiet --stdin >cnt &&\n-\ttest_line_count = 1 cnt\n+\ttest_line_count = 0 cnt\n '\n test_expect_success 'git diff-tree HEAD HEAD' '\n \ttest_expect_code 0 git diff-tree --quiet HEAD HEAD >cnt &&\n\n---\nhttps://github.com/git/git/pull/163\n"},{"id":"266606","messageId":"692dbd9ee45e10a17587970eaa2a1c4e@www.dscho.org","threadId":"39915","inReplyTo":"0000014eb518dc87-a69705c4-31e7-4983-99a8-f780a743aeac-000000@eu-west-1.amazonses.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-07-22T11:42:41Z","receivedAt":"2015-07-22T11:42:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On 2015-07-22 11:29, Sebastian Schuberth wrote:\n> \"--quite\" is documented to \"Disable all output of the program\".\n\ns/--quite/quiet/\n"},{"id":"266607","messageId":"0000014eb59ef0ad-3d1a00df-9c6b-4414-8f64-6fb959c996a9-000000@eu-west-1.amazonses.com","threadId":"39915","inReplyTo":"692dbd9ee45e10a17587970eaa2a1c4e@www.dscho.org","subject":"[PATCH v2] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-07-22T11:56:09Z","receivedAt":"2015-07-22T11:56:09Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"\"--quiet\" is documented to \"Disable all output of the program\". Yet\ncalling diff-tree with a single commit like\n\n$ git diff-tree --quiet c925fe2\n\nwas logging\n\nc925fe23684455735c3bb1903803643a24a58d8f\n\nto the console despite \"--quiet\" being given. This is inconsistent with\nboth the docs and the behavior if more than a single commit is passed to\ndiff-tree. Moreover, the output of that single line seems to be documented\nnowhere except in a comment for a test. Fix this inconsistency by making\ndiff-tree really output nothing if \"--quiet\" is given and fix the test\naccordingly.\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n log-tree.c            | 3 ++-\n t/t4035-diff-quiet.sh | 3 +--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/log-tree.c b/log-tree.c\nindex 01beb11..3c98234 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -741,7 +741,8 @@ int log_tree_diff_flush(struct rev_info *opt)\n \t}\n \n \tif (opt->loginfo && !opt->no_commit_id) {\n-\t\tshow_log(opt);\n+\t\tif (!DIFF_OPT_TST(&opt->diffopt, QUICK))\n+\t\t\tshow_log(opt);\n \t\tif ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) &&\n \t\t    opt->verbose_header &&\n \t\t    opt->commit_format != CMIT_FMT_ONELINE &&\ndiff --git a/t/t4035-diff-quiet.sh b/t/t4035-diff-quiet.sh\nindex 461f4bb..9a8225f 100755\n--- a/t/t4035-diff-quiet.sh\n+++ b/t/t4035-diff-quiet.sh\n@@ -40,11 +40,10 @@ test_expect_success 'git diff-tree HEAD^ HEAD -- b' '\n \ttest_expect_code 1 git diff-tree --quiet HEAD^ HEAD -- b >cnt &&\n \ttest_line_count = 0 cnt\n '\n-# this diff outputs one line: sha1 of the given head\n test_expect_success 'echo HEAD | git diff-tree --stdin' '\n \techo $(git rev-parse HEAD) |\n \ttest_expect_code 1 git diff-tree --quiet --stdin >cnt &&\n-\ttest_line_count = 1 cnt\n+\ttest_line_count = 0 cnt\n '\n test_expect_success 'git diff-tree HEAD HEAD' '\n \ttest_expect_code 0 git diff-tree --quiet HEAD HEAD >cnt &&\n\n---\nhttps://github.com/git/git/pull/163\n"},{"id":"266630","messageId":"xmqqmvyoq6gh.fsf@gitster.dls.corp.google.com","threadId":"39915","inReplyTo":"0000014eb518dc87-a69705c4-31e7-4983-99a8-f780a743aeac-000000@eu-west-1.amazonses.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-22T20:32:14Z","receivedAt":"2015-07-22T20:32:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sebastian Schuberth <sschuberth@gmail.com> writes:\n\n> \"--quite\" is documented to \"Disable all output of the program\". Yet\n> calling diff-tree with a single commit like\n>\n> $ git diff-tree --quiet c925fe2\n>\n> was logging\n>\n> c925fe23684455735c3bb1903803643a24a58d8f\n\nAt this point, unfortunately I think we need to call that a\ndocumentation bug.  The \"output\" it refers to is output from the\n\"diff\" portion, not the \"poor-man's log\" portion, of the program,\nwhere diff-tree was the workhorse behind scripted \"git log\" that\ngave the commit object name as the preamble for each commit it\nshows information about.\n"},{"id":"266647","messageId":"CAHGBnuM5TG6m7Rwd-EZTUXnaDNYomidthmCamCevNECTQCTnmA@mail.gmail.com","threadId":"39915","inReplyTo":"xmqqmvyoq6gh.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-07-23T07:06:01Z","receivedAt":"2015-07-23T07:06:01Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Wed, Jul 22, 2015 at 10:32 PM, Junio C Hamano <gitster@pobox.com> wrote:\n\n>> \"--quite\" is documented to \"Disable all output of the program\". Yet\n>> calling diff-tree with a single commit like\n>>\n>> $ git diff-tree --quiet c925fe2\n>>\n>> was logging\n>>\n>> c925fe23684455735c3bb1903803643a24a58d8f\n>\n> At this point, unfortunately I think we need to call that a\n> documentation bug.  The \"output\" it refers to is output from the\n> \"diff\" portion, not the \"poor-man's log\" portion, of the program,\n> where diff-tree was the workhorse behind scripted \"git log\" that\n> gave the commit object name as the preamble for each commit it\n> shows information about.\n\nWell, from a user's perspective it does not matter which part of the\ninternal implementation of diff-tree is responsible for printing that\nsingle line, a user would just expect \"--quiet\" to really mean\n\"quiet\". As for almost any bug, we could turn it into a feature by\n\"fixing\" the docs and claiming it's documented behavior. To me the\nquestion simply is whether it makes sense for \"--quiet\" to not be\nquiet, and I think it does not make sense. If you run diff-tree this\nway there is no added value in the given output.\n\nMy use-case (also see [1]) is that I wanted to checked whether some\ngiven commits change nothing but whitespace. So I did\n\nif git diff-tree --quiet --ignore-space-change $commit; then\n    echo \"$commit only changes whitespace.\"\nfi\n\njust to see those SHA1s being printed to the console.\n\nI probably could instead do\n\nif git diff-tree --exit-code --ignore-space-change $commit > /dev/null\n2>&1; then\n    echo \"$commit only changes whitespace.\"\nfi\n\nbut that defeats the purpose of having \"--quiet\" in the first place.\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/273975\n\n-- \nSebastian Schuberth\n"},{"id":"266665","messageId":"xmqqegjyrfrq.fsf@gitster.dls.corp.google.com","threadId":"39915","inReplyTo":"CAHGBnuM5TG6m7Rwd-EZTUXnaDNYomidthmCamCevNECTQCTnmA@mail.gmail.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-23T16:38:01Z","receivedAt":"2015-07-23T16:38:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sebastian Schuberth <sschuberth@gmail.com> writes:\n\n> Well, from a user's perspective it does not matter which part of the\n> internal implementation of diff-tree is responsible for printing that\n> single line,...\n\nThat is not \"internal implementation\", but \"logically separate\nparts\".  View it more like \"'git show -s' does squelch the diff part\nbut does not squelch the log output\".  After all, a single commit form\nof 'diff-tree' is a degenerate use case of feeding a single commit\nto 'diff-tree --stdin' from its standard input, which is a rough\nplumbing-level equivalent of 'show'.\n\nDocumenting the behaviour correctly is the best thing you could do\nat this point, as this is one of the oldest part of the system that\nexisting scripts would rely on.\n"},{"id":"266667","messageId":"xmqq615aregb.fsf@gitster.dls.corp.google.com","threadId":"39915","inReplyTo":"xmqqegjyrfrq.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-23T17:06:28Z","receivedAt":"2015-07-23T17:06:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sebastian Schuberth <sschuberth@gmail.com> writes:\n>\n>> Well, from a user's perspective it does not matter which part of the\n>> internal implementation of diff-tree is responsible for printing that\n>> single line,...\n>\n> That is not \"internal implementation\", but \"logically separate\n> parts\".  View it more like \"'git show -s' does squelch the diff part\n> but does not squelch the log output\".  After all, a single commit form\n> of 'diff-tree' is a degenerate use case of feeding a single commit\n> to 'diff-tree --stdin' from its standard input, which is a rough\n> plumbing-level equivalent of 'show'.\n>\n> Documenting the behaviour correctly is the best thing you could do\n> at this point, as this is one of the oldest part of the system that\n> existing scripts would rely on.\n\nHaving said that.\n\nExisting scripts by definition would not be using a new option you\nwill invent that used not to be a valid one.  So that would be one\nway that you can shorten your script without breaking other people.\n\nIf we were living in an ideal world equipped with a time machine, I\nwould redesign \"git diff-tree $commit\" so that it does not show the\ncommit object name in its output at all, with or without \"--quiet\".\n\nIn \"git rev-list ... | git diff-tree --stdin\" output, the commit\nobject name is absolutely necessary, with or without --quiet, as it\nserves as the sign that the output switched to talk about a\ndifferent commit.  But the case that feeds a single commit to the\ncommand, used as a poor-man's \"git show $commit\", does not need\none---the caller knows exactly which commit the output is about.  It\nis an unfortunate historical accident that a single commit usage is\ndefined to be a degenerate case of feeding a sequence of commits to\nthe command and the length of the sequence happens to be one.\n\nBut we do not live in an ideal world.\n"},{"id":"266678","messageId":"20150723180846.GB18686@peff.net","threadId":"39915","inReplyTo":"CAHGBnuM5TG6m7Rwd-EZTUXnaDNYomidthmCamCevNECTQCTnmA@mail.gmail.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-07-23T18:08:46Z","receivedAt":"2015-07-23T18:08:46Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jul 23, 2015 at 09:06:01AM +0200, Sebastian Schuberth wrote:\n\n> My use-case (also see [1]) is that I wanted to checked whether some\n> given commits change nothing but whitespace. So I did\n> \n> if git diff-tree --quiet --ignore-space-change $commit; then\n>     echo \"$commit only changes whitespace.\"\n> fi\n> \n> just to see those SHA1s being printed to the console.\n> \n> I probably could instead do\n> \n> if git diff-tree --exit-code --ignore-space-change $commit > /dev/null\n> 2>&1; then\n>     echo \"$commit only changes whitespace.\"\n> fi\n> \n> but that defeats the purpose of having \"--quiet\" in the first place.\n\nI have not been following the thread closely, but I do not recall seeing\nanyone mention that the reason for the sha1-output is handing\nonly a single commit-ish to diff-tree is what puts it into its log-like\nmode. Actually asking for a two-endpoint tree diff:\n\n  git diff-tree --quiet --ignore-space-change $commit^ $commit\n\nwill do what you want.\n\nI know that does not necessarily help the greater issue of \"what\ndiff-tree is doing is confusing\", but perhaps that sheds some light at\nleast on why it is doing what it is doing. :)\n\n-Peff\n"},{"id":"266681","messageId":"xmqq4mkupss7.fsf@gitster.dls.corp.google.com","threadId":"39915","inReplyTo":"20150723180846.GB18686@peff.net","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-23T19:39:52Z","receivedAt":"2015-07-23T19:39:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I have not been following the thread closely, but I do not recall seeing\n> anyone mention that the reason for the sha1-output is handing\n> only a single commit-ish to diff-tree is what puts it into its log-like\n> mode. Actually asking for a two-endpoint tree diff:\n>\n>   git diff-tree --quiet --ignore-space-change $commit^ $commit\n>\n> will do what you want.\n\nYeah, if we were living in an ideal world equipped with a time\nmachine, I would redesign \"git diff-tree $commit\" so that it does\nnot show the commit object name in its output at all, with or\nwithout \"--quiet\".\n\nIn \"git rev-list ... | git diff-tree --stdin\" output, the commit\nobject name is absolutely necessary, with or without --quiet, as it\nserves as the sign that the output switched to talk about a\ndifferent commit.\n\nBut the case that feeds a single commit to the command, used as a\npoor-man's \"git show $commit\", does not need one---the caller knows\nexactly which commit the output is about.\n\nIt is an unfortunate historical accident that a single commit usage\nis defined to be a degenerate case of feeding a sequence of commits\nto the command and the length of the sequence happens to be one.\n\"diff-tree $commit\" could instead have been defined as a short-hand\nfor \"diff-tree $commit^ $commit\", but (1) we do not live in an ideal\nworld, and (2) it ignores $commit^2 and later parents.\n\nThis is a tangent, but I suspect that the current implementation of\n\"diff-tree --stdin --quiet\" may be buggy and does not consistently\nshow the commits that touch the given path.\n\n $ git rev-list master..jc/rerere | git diff-tree --stdin -s rerere.h\n\ngives what is expected (shows the commit object names, but being\nsilent on the differences), while s/-s/--quiet/ seems to omit every\nother commit from the output, or something silly like that.\n\nI haven't dug into why that happens, but possible ways to fix that\nare to make \"--quiet\" output all (making it consistent with \"-s\") or\nno (making the command totally silent) output at all ;-).\n"},{"id":"266682","messageId":"CAHGBnuMmOiYUtrOZzA9AV0qTV3_8BT5fgo=5gJ4FYYWV9dEKaA@mail.gmail.com","threadId":"39915","inReplyTo":"20150723180846.GB18686@peff.net","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-07-23T20:02:27Z","receivedAt":"2015-07-23T20:02:27Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Thu, Jul 23, 2015 at 8:08 PM, Jeff King <peff@peff.net> wrote:\n\n> mode. Actually asking for a two-endpoint tree diff:\n>\n>   git diff-tree --quiet --ignore-space-change $commit^ $commit\n>\n> will do what you want.\n\nYes, I know, thanks. But I deliberately wanted to specify only a\nsingle commit as an optimization, hoping that it would be slightly\nfaster than computing a commit range.\n\n-- \nSebastian Schuberth\n"},{"id":"266683","messageId":"CAHGBnuMdpGHm7wGSA9qCAqns=nd5F5-vg9g4AW9Z6k-4NYk3jw@mail.gmail.com","threadId":"39915","inReplyTo":"xmqq615aregb.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-07-23T20:13:39Z","receivedAt":"2015-07-23T20:13:39Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Thu, Jul 23, 2015 at 7:06 PM, Junio C Hamano <gitster@pobox.com> wrote:\n\n> Existing scripts by definition would not be using a new option you\n> will invent that used not to be a valid one.  So that would be one\n> way that you can shorten your script without breaking other people.\n\nTrue. If it was only for shortening my script, I still could do \">\n/dev/null 2>&1\" which is just as short (or long) as a newly introduced\n\"--really-quiet\" option. But I'm also concerned about consistency and\nmaking options do what they sound they would do.\n\n> In \"git rev-list ... | git diff-tree --stdin\" output, the commit\n> object name is absolutely necessary, with or without --quiet, as it\n\nWhy is printing the object name also necessary with \"--quiet\"? I'd\nargue that any script that uses diff-tree that way uses --stdin\nwithout --quiet, just like you do in your example, so suppressing the\nobject name if \"--quiet\" is given probably would not break as many\nscripts as you think.\n\n> But we do not live in an ideal world.\n\nTrue, but we should never stop striving after making it one :-)\n\n-- \nSebastian Schuberth\n"},{"id":"266684","messageId":"CAHGBnuM6sgegeq0AXTcS7QNX4_X3GYNf--srq0HH0K_owG3JQg@mail.gmail.com","threadId":"39915","inReplyTo":"xmqq4mkupss7.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-07-23T20:19:07Z","receivedAt":"2015-07-23T20:19:07Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Thu, Jul 23, 2015 at 9:39 PM, Junio C Hamano <gitster@pobox.com> wrote:\n\n> I haven't dug into why that happens, but possible ways to fix that\n> are to make \"--quiet\" output all (making it consistent with \"-s\") or\n> no (making the command totally silent) output at all ;-).\n\nExactly, and I chose the latter to add some value to --quiet instead\nof making it an alias for -s.\n\n-- \nSebastian Schuberth\n"},{"id":"266685","messageId":"xmqqzj2mobac.fsf@gitster.dls.corp.google.com","threadId":"39915","inReplyTo":"CAHGBnuM6sgegeq0AXTcS7QNX4_X3GYNf--srq0HH0K_owG3JQg@mail.gmail.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-23T20:43:07Z","receivedAt":"2015-07-23T20:43:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sebastian Schuberth <sschuberth@gmail.com> writes:\n\n> On Thu, Jul 23, 2015 at 9:39 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>> I haven't dug into why that happens, but possible ways to fix that\n>> are to make \"--quiet\" output all (making it consistent with \"-s\") or\n>> no (making the command totally silent) output at all ;-).\n>\n> Exactly, and I chose the latter to add some value to --quiet instead\n> of making it an alias for -s.\n\nHeh.  You didn't even know when \"diff-tree --stdin --quiet\" would be\nuseful, let alone that it had a bug that made it useless for that\nexact use case.  So it cannot be \"I chose the latter\".\n\nI just gave you a hint so that you can write a plausible-sounding\njustification, and we both know that it is very different from your\noriginal motivation.\n\nBe honest.\n\nPerhaps the log message would say something like this:\n\n\t$ git rev-list ... | git diff-tree --stdin --quiet [$pathspec]\n\n\tis a way to list the commits that modifies the named paths,\n        but this bug <<<analysis of the bug comes here>>> makes it\n        not to emit all such commits.  It couldn't have been used\n        by existing scripts with this longstanding bug.\n\n\tWe could fix it so that it does not randomly skip commits\n\tthat ought to be shown, but that feature is already\n\tavailable by the \"-s\" option instead of \"--quiet\".\n\n        So let's change the meaning of \"--quiet\" to make it really\n        quiet, without giving any output.  Strictly speaking, this\n        may break backward compatibility but the existing behaviour\n        to randomly omit commits couldn't have been useful, so there\n        is no harm done.\n\n\tAnd as an added bonus,\n\n\t$ git diff-tree --quiet $commit [$pathspec]\n\n\twould stop showing the commit object name.\n\nThe analysis of the bug is really crucial for the above description\nto work as justification for this change, substanciating the words\n\"longstanding\" and \"randomly omit\" that are used to convince us that\nthis option couldn't have been used by real scripts.\n"},{"id":"266714","messageId":"20150724065601.GA2111@peff.net","threadId":"39915","inReplyTo":"CAHGBnuMmOiYUtrOZzA9AV0qTV3_8BT5fgo=5gJ4FYYWV9dEKaA@mail.gmail.com","subject":"Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-07-24T06:56:01Z","receivedAt":"2015-07-24T06:56:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jul 23, 2015 at 10:02:27PM +0200, Sebastian Schuberth wrote:\n\n> On Thu, Jul 23, 2015 at 8:08 PM, Jeff King <peff@peff.net> wrote:\n> \n> > mode. Actually asking for a two-endpoint tree diff:\n> >\n> >   git diff-tree --quiet --ignore-space-change $commit^ $commit\n> >\n> > will do what you want.\n> \n> Yes, I know, thanks. But I deliberately wanted to specify only a\n> single commit as an optimization, hoping that it would be slightly\n> faster than computing a commit range.\n\nAh, I see. It should not be any faster, as git has to internally find\nthe first-parent of $commit either way. The big thing you lose with the\nabove syntax is that you are specifying two endpoints, so you cannot do\nanything clever with merge commits (e.g., if you gave \"--cc\").\n\n-Peff\n"}]}