deb-python-pygit2/docs/recipes/git-show.rst
2013-07-05 20:14:33 -04:00

1.5 KiB

git-show

Showing a commit

$> git show d370f56
>>> repo = pygit2.Repository('/path/to/repository')
>>> commit = repo.revparse_single('d370f56')

Show log message

>>> message = commit.message

Show SHA hash

>>> hash = commit.hex

Show diff

>>> diff = commit.tree.diff()

Show all files in commit

>>> for e in commit.tree: >>> print(e.name)

References