deb-python-pygit2/docs/recipes/git-log.rst
Carlos Martín Nieto 1cc112c32f docs: adjust to recent changes
It seems I have been forgetting to update the documentation with the
last few  changes, so adjust to the oid -> id renaming and add missing
attributes to the listings.
2014-01-25 04:25:42 +01:00

1.2 KiB

git-log

Showing HEAD commit logs

Show HEAD commit

$> git log -1
>>> commit = repo[repo.head.target]
>>> commit.message
'commit message'

Traverse commit history

$> git log
>>> last = repo[repo.head.target]
>>> for commit in repo.walk(last.id, pygit2.GIT_SORT_TIME):
>>>     print(commit.message) # or some other operation

References