summaryrefslogtreecommitdiffstats
path: root/gitsrht/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitsrht/git.py')
-rw-r--r--gitsrht/git.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gitsrht/git.py b/gitsrht/git.py
index e6808b9..0e6f938 100644
--- a/gitsrht/git.py
+++ b/gitsrht/git.py
@@ -12,6 +12,13 @@ def trim_commit(msg):
return msg
return msg[:msg.index("\n")]
+def commits_since_rev(repo, rev):
+ i = 0
+ for commit in repo.walk(repo.head.target):
+ if commit.id == rev:
+ break
+ return i
+
def commit_time(commit):
author = commit.author if hasattr(commit, 'author') else commit.tagger
# Time handling in python is so dumb