{"thread":{"id":"27016","subject":"git diff-tree output inconsistency?","startedAt":"2011-04-07T13:59:38Z","lastAt":"2011-04-07T19:08:32Z","messageCount":2,"participants":["Arjen Laarhoven","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"165357","messageId":"20110407135938.GA322@regex.yaph.org","threadId":"27016","inReplyTo":null,"subject":"git diff-tree output inconsistency?","fromName":"Arjen Laarhoven","fromEmail":"arjen@yaph.org","sentAt":"2011-04-07T13:59:38Z","receivedAt":"2011-04-07T13:59:38Z","isPatch":false,"sender":{"key":"arjen@yaph.org","avatar":"https://gravatar.com/avatar/f776c2c0c5ea62d70827b942eb7d95ce85661a3d70bc3f03cf9773815c599c01?d=mp&s=160"},"body":"Hi all,\n\nI was fiddling with the git-diff-tree command to retrieve a list of\nfiles which have in a commit:\n\n$ git diff-tree --name-only HEAD\n\nAccording to the documentation, the output starts with the SHA-1 of the\ntree-ish given, after which the list of changed files follows.  This is\nthe case when just one commit-id is given.\n\nHowever, when given 2 tree-ish objects, the separate line with the SHA-1\nis not shown.\n\nI browsed through the code and the history for diff-tree.c, but couldn't\nfind an explanation for the inconsistency.  The documentation for the\n--no-commit-id confuses me a bit more, as it states that the commit id\nis shown 'when applicable'.  Unfortunately, it fails to explain when\nexactly that is :-)\n\nHave I found a documentation bug/shortcoming, is it a code bug or am I\nmisunderstanding something else?\n\nArjen\n\n-- \nArjen Laarhoven\n\nThe presence of those seeking the truth is infinitely to be preferred to \nthose who think they've found it.\n                                -- Terry Pratchett, \"Monstrous Regiment\"\n"},{"id":"165373","messageId":"20110407190832.GA18842@sigill.intra.peff.net","threadId":"27016","inReplyTo":"20110407135938.GA322@regex.yaph.org","subject":"Re: git diff-tree output inconsistency?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-04-07T19:08:32Z","receivedAt":"2011-04-07T19:08:32Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Apr 07, 2011 at 03:59:38PM +0200, Arjen Laarhoven wrote:\n\n> I was fiddling with the git-diff-tree command to retrieve a list of\n> files which have in a commit:\n> \n> $ git diff-tree --name-only HEAD\n> \n> According to the documentation, the output starts with the SHA-1 of the\n> tree-ish given, after which the list of changed files follows.  This is\n> the case when just one commit-id is given.\n> \n> However, when given 2 tree-ish objects, the separate line with the SHA-1\n> is not shown.\n> \n> I browsed through the code and the history for diff-tree.c, but couldn't\n> find an explanation for the inconsistency.  The documentation for the\n> --no-commit-id confuses me a bit more, as it states that the commit id\n> is shown 'when applicable'.  Unfortunately, it fails to explain when\n> exactly that is :-)\n> \n> Have I found a documentation bug/shortcoming, is it a code bug or am I\n> misunderstanding something else?\n\nI think it's a documentation bug. The sha1 is shown only when a single\ntree-ish is given (either on the command line, or via --stdin). This is\na historical behavior, as one of the original uses of diff-tree was\nto implement log as:\n\n  git rev-list | git diff-tree --stdin\n\nYou can even do \"git diff-tree --stdin --pretty=medium\" to get the full\nlog-ish output.  These days, though, log does everything in one process.\n\nBut I don't think we make that clear anywhere in the diff-tree manpage.\n\n-Peff\n"}]}