git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] diff-tree: do not show the sha1 of the given head with --quiet

From
Sebastian Schuberth <sschuberth@gmail.com>
Date
Jul 23, 2015, 07:06 UTC
Message-ID
<CAHGBnuM5TG6m7Rwd-EZTUXnaDNYomidthmCamCevNECTQCTnmA@mail.gmail.com>
In-Reply-To
<xmqqmvyoq6gh.fsf@gitster.dls.corp.google.com>
On Wed, Jul 22, 2015 at 10:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
>> "--quite" is documented to "Disable all output of the program". Yet
>> calling diff-tree with a single commit like
>>
>> $ git diff-tree --quiet c925fe2
>>
>> was logging
>>
>> c925fe23684455735c3bb1903803643a24a58d8f
>
> At this point, unfortunately I think we need to call that a
> documentation bug.  The "output" it refers to is output from the
> "diff" portion, not the "poor-man's log" portion, of the program,
> where diff-tree was the workhorse behind scripted "git log" that
> gave the commit object name as the preamble for each commit it
> shows information about.

Well, from a user's perspective it does not matter which part of the internal implementation of diff-tree is responsible for printing that single line, a user would just expect "--quiet" to really mean "quiet". As for almost any bug, we could turn it into a feature by "fixing" the docs and claiming it's documented behavior. To me the question simply is whether it makes sense for "--quiet" to not be quiet, and I think it does not make sense. If you run diff-tree this way there is no added value in the given output.

My use-case (also see [1]) is that I wanted to checked whether some given commits change nothing but whitespace. So I did

if git diff-tree --quiet --ignore-space-change $commit; then
    echo "$commit only changes whitespace."
fi
just to see those SHA1s being printed to the console.
I probably could instead do
if git diff-tree --exit-code --ignore-space-change $commit > /dev/null
2>&1; then
    echo "$commit only changes whitespace."
fi
but that defeats the purpose of having "--quiet" in the first place.
[1] http://article.gmane.org/gmane.comp.version-control.git/273975
-- 
Sebastian Schuberth
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 14 in “diff-tree: do not show the sha1 of the given head with --quiet”
  1. diff-tree: do not show the sha1 of the given head with --quietSebastian Schuberth, Jul 22, 2015
  2. Johannes SchindelinJul 22, 2015
  3. diff-tree: do not show the sha1 of the given head with --quietSebastian Schuberth, Jul 22, 2015
  4. Junio C HamanoJul 22, 2015
  5. Sebastian SchuberthJul 23, 2015
  6. Junio C HamanoJul 23, 2015
  7. Junio C HamanoJul 23, 2015
  8. Sebastian SchuberthJul 23, 2015
  9. Jeff KingJul 23, 2015
  10. Junio C HamanoJul 23, 2015
  11. Sebastian SchuberthJul 23, 2015
  12. Junio C HamanoJul 23, 2015
  13. Sebastian SchuberthJul 23, 2015
  14. Jeff KingJul 24, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.