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

Problem: `fatal: too-short tree object` when executing hash-object on tree

From
GHGareth Hayes <gareth.hayes@bitcoin.org.hk>
Date
Aug 31, 2023, 10:58 UTC
Message-ID
<0de414f8-f409-467f-a504-06a78f088981@app.fastmail.com>
Problem: I'm trying to reproduce the identifier of a tree object using `git cat-file -p <tree object identifier> | git hash-object -t tree --stdin`

This results in an error: `fatal: too-short tree object`

To replicate: `git cat-file -p HEAD` `git cat-file -p <tree object identifier from output of above> | git hash-object -t tree --stdin`

This works for other object types but not trees. What am I doing wrong?
Next: Johannes Sixt
Message 1 of 3 in “Problem: `fatal: too-short tree object` when executing hash-object on tree”
  1. Gareth HayesAug 31, 2023
  2. Johannes SixtAug 31, 2023
  3. Junio C HamanoAug 31, 2023

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.