On Tue, May 21, 2013 at 5:21 PM, Chico Sokol <chico.so...@gmail.com> wrote:
> Hello,
> I'm building a library to manipulate git repositories (interacting
> directly with the filesystem).
> Currently, we're trying to parse commit objects. After decompressing
> the contents of a commit object file we got the following output:
> commit 191
> author Francisco Sokol <chico.so...@gmail.com> 1369140112 -0300
> committer Francisco Sokol <chico.so...@gmail.com> 1369140112 -0300
> first commit

Does `git cat-file -p <sha1>` show a tree object?  FWIW, I expected to
see a tree line there, so maybe this object was created without a
tree?  I also don't see a parent listed.

I did this on one of my repos:

>>> buf = open('.git/objects/cd/da219e4d7beceae55af73c44cb3c9e1ec56802', 
>>> 'rb').read()
>>> import zlib
>>> zlib.decompress(buf)
'commit 246\x00tree 2abfe1a7bedb29672a223a5c5f266b7dc70a8d87\nparent
0636e7ff6b79470b0cd53ceacea88e7796f202ce\nauthor John Szakmeister
<j...@szakmeister.net> 1369168481 -0400\ncommitter John Szakmeister
<j...@szakmeister.net> 1369168481 -0400\n\nGot a file listing.\n'

So at least creating the commits with Git, I see a tree.  How was the
commit you're referencing created?  Perhaps something is wrong with
that process?

> We hoped to get the same output of a "git cat-file -p <sha1>", but
> that didn't happened. From a commit object, how can I find tree object
> hash of this commit?

I'd expect that too.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to