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

git diff-tree output inconsistency?

From
Arjen Laarhoven <arjen@yaph.org>
Date
Apr 7, 2011, 13:59 UTC
Message-ID
<20110407135938.GA322@regex.yaph.org>
Hi all,

I was fiddling with the git-diff-tree command to retrieve a list of files which have in a commit:

$ git diff-tree --name-only HEAD

According to the documentation, the output starts with the SHA-1 of the tree-ish given, after which the list of changed files follows. This is the case when just one commit-id is given.

However, when given 2 tree-ish objects, the separate line with the SHA-1 is not shown.

I browsed through the code and the history for diff-tree.c, but couldn't find an explanation for the inconsistency. The documentation for the --no-commit-id confuses me a bit more, as it states that the commit id is shown 'when applicable'. Unfortunately, it fails to explain when exactly that is :-)

Have I found a documentation bug/shortcoming, is it a code bug or am I misunderstanding something else?

Arjen
-- 
Arjen Laarhoven

The presence of those seeking the truth is infinitely to be preferred to 
those who think they've found it.
                                -- Terry Pratchett, "Monstrous Regiment"
Next: Jeff King
Message 1 of 2 in “git diff-tree output inconsistency?”
  1. Arjen LaarhovenApr 7, 2011
  2. Jeff KingApr 7, 2011

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.