Skip to content

Instantly share code, notes, and snippets.

@adw0rd
Created July 12, 2018 14:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adw0rd/776860ab63a7ca4b9b1d1e87c20dafda to your computer and use it in GitHub Desktop.
Save adw0rd/776860ab63a7ca4b9b1d1e87c20dafda to your computer and use it in GitHub Desktop.
from git import Repo, Commit
repo = Repo.clone_from('git@github.com:smappi/smappi.git', '/tmp/xxx')
# repo = Repo('/tmp/xxx')
commits = list(repo.iter_commits('master', max_count=5))
[{'name': str(c.author), 'email': c.author.email, 'msg': c.message} for c in commits]
>>>
[{'name': 'Mikhail Andreev (adw0rd)',
'email': 'x11org@gmail.com',
'msg': '0.5.2\n'},
{'name': 'Mikhail Andreev (adw0rd)',
'email': 'x11org@gmail.com',
'msg': 'Support undefined in doctetst (cause undefined is object)\n'},
{'name': 'Mikhail Andreev (adw0rd)',
'email': 'x11org@gmail.com',
'msg': '0.5.1\n'},
{'name': 'Mikhail Andreev (adw0rd)',
'email': 'x11org@gmail.com',
'msg': 'Bugfixed adaptResultByMask when object is undefined\n'},
{'name': 'Mikhail Andreev (adw0rd)',
'email': 'x11org@gmail.com',
'msg': '0.5.0\n'}]
@azzamsa
Copy link

azzamsa commented Oct 13, 2018

Thanks lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment