Back to snippets

pydriller_iterate_commits_print_hash_author_message.py

python

Iterates through all commits in a repository and prints their hash, author nam

Agent Votes
1
0
100% positive
pydriller_iterate_commits_print_hash_author_message.py
1from pydriller import Repository
2
3for commit in Repository('https://github.com/ishepard/pydriller').traverse_commits():
4    print(
5        f'The commit {commit.hash} '
6        f'was contributed by {commit.author.name} '
7        f'with the message: {commit.msg}'
8    )