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

2 messages from 2006-10-01 to 2006-10-01. Participants: Sebastian Harl, Johannes Schindelin.
Thread: https://gitlist.dev/t/5781

## Sebastian Harl, 2006-10-01 20:26

Subject: [BUG] "git cat-file tree <sha1>" prints garbage
Message-ID: <20061001202602.GD32373@albany.tokkee.org>
URL: https://gitlist.dev/e/20061001202602.GD32373%40albany.tokkee.org

```
Hi,

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)

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl
GnuPG-ID: 0x8501C7FC
http://tokkee.org/


```

## Johannes Schindelin, 2006-10-01 20:48

Subject: Re: [BUG] "git cat-file tree <sha1>" prints garbage
Message-ID: <Pine.LNX.4.63.0610012247330.14200@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0610012247330.14200%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <20061001202602.GD32373@albany.tokkee.org>

```
Hi,

On Sun, 1 Oct 2006, Sebastian Harl wrote:

> 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

```
