top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Reading commit objects

+1 vote
218 views

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  ********** -0300
committer Francisco Sokol  ********** -0300

first commit

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

posted May 21, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

git rev-parse :

answer May 21, 2013 by anonymous
Similar Questions
+2 votes

Could somebody tell me how to make git rebase -i show diff of squashed commits (for example), like git commit -v does it?

+2 votes

Is it possible to add custom metadata to Git commit object?
Such metadata should be ignored by Git commands, but could be used by a 3-party tool which knows the format and knows where to look.

I assume that this should be possible, given that Git objects are actually patches, and patches can contain additional details. But can this be done with the help of Git commands?

+2 votes

When does git shows message "nothing added to commit but untracked files present " ?

+1 vote

I have added some changes on commit message in prepare-commit-msg file and then I exec this command

git config --global commit.template .git/hooks/prepare-commit-msg  

After that when I do git commit I receive something like this

40 lines of my changes and then  

# Please enter the commit message for your changes. Lines starting # with # will be ignored, 
  and an empty message aborts the commit. # Explicit paths specified without -i nor -o; 
  assuming --only paths... # On branch master # Changes to be committed: # # modified: test #  

Question is there any chance to show this default message on the top? Or better permanently remove this message?

...