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

[BUG] git diff-tree --stdin doesn't accept two trees

From
Karl Hasselström <kha@treskal.com>
Date
Aug 5, 2008, 16:48 UTC
Message-ID
<20080805164839.GA3934@diana.vm.bytemark.co.uk>

I'm trying to use diff-tree --stdin to diff several trees in one go. But I just get error messages when I feed it two space-separated trees (one commit works fine):

  $ echo $(git rev-parse HEAD^{tree}) $(git rev-parse HEAD^^{tree}) | git diff-tree -p --stdin
  error: Object 7bfd9971f77438858e412be0219ec78afb3ca46f not a commit
This is at odds with the documentation:
  --stdin::
        When '--stdin' is specified, the command does not take
        <tree-ish> arguments from the command line.  Instead, it
        reads either one <commit> or a pair of <tree-ish>
        separated with a single space from its standard input.

I tried reading the code to figure out what's wrong, and as far as I can tell the code to do this is there, but seems to be protected by logic that aborts everything unless the whole input line is a valid commit. Or maybe I'm just confused ...

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Next: Junio C Hamano
Message 1 of 6 in “[BUG] git diff-tree --stdin doesn't accept two trees”
  1. Karl HasselströmAug 5, 2008
  2. Junio C HamanoAug 5, 2008
  3. fix diff-tree --stdin documentationJunio C Hamano, Aug 6, 2008
  4. Karl HasselströmAug 6, 2008
  5. Karl HasselströmAug 6, 2008
  6. Junio C HamanoAug 6, 2008

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.