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

Re: [BUG] "git cat-file tree <sha1>" prints garbage

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 1, 2006, 20:48 UTC
Message-ID
<Pine.LNX.4.63.0610012247330.14200@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<20061001202602.GD32373@albany.tokkee.org>
Hi,
On Sun, 1 Oct 2006, Sebastian Harl wrote:
Show 13 quoted lines
> When using "git cat-file tree <sha1>" to print a tree's content, it produces
> garbage output like the following:
> 
>   $ git cat-file -t c0cd1e4e1888be6a70d44476996ece8be1ab52a2
>   tree
>   $ git cat-file tree c0cd1e4e1888be6a70d44476996ece8be1ab52a2
>   100644 .gitignore%ëF7¦ùq¤¢«‚:“y—ǽ100644
>   COPYINGoø|Fd˜C—bW‘Èê;»_"y£40000 DocumentationŠ>Ý¢ÞÀŸçœ $ë#ºâü100755
>   GIT-VERSION-GEN
>   [...]
> 
> Using "git cat-file -p <sha1>" works fine.
> (The above example uses one of the latest commits of the git.git repository)

That is not a bug. "git cat-file tree <sha1>" produces the _exact_ contents of the object, while "-p" _pretty_-prints the contents.

Ciao, Dscho

Previous: Sebastian Harl
Message 2 of 2 in “[BUG] "git cat-file tree <sha1>" prints garbage”
  1. Sebastian HarlOct 1, 2006
  2. Johannes SchindelinOct 1, 2006

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.