summaryrefslogtreecommitdiffstats
path: root/gitsrht/git.py
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-07-23 20:16:52 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-07-23 20:16:52 +0200
commit836e00f67ba2c67a89a9b62092743c44985a8a2a (patch)
tree154c251d33af8863f715a8afc2476fc445522547 /gitsrht/git.py
parent61fb547f64f95c7132459a8bce012f4d52237709 (diff)
Add commits-since-tagHEADmaster
This patch adds a "commits since tag" output in the refs view.
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