aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil <neil@dip.sun.ac.za>2016-03-14 13:40:52 +0200
committerNeil <neil@dip.sun.ac.za>2016-03-14 13:40:52 +0200
commit3e28d953dec677866fb47b53678ab857885ceb60 (patch)
treed8d8416ebca4756d5a73c497e47ddb337c62fe0e
parentUse git log to get the abbreviated hash (diff)
downloadirker-3e28d953dec677866fb47b53678ab857885ceb60.tar.xz
Also shorten the commit used for the standard webview urls
-rwxr-xr-xirkerhook.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/irkerhook.py b/irkerhook.py
index 5e7651a..1482200 100755
--- a/irkerhook.py
+++ b/irkerhook.py
@@ -283,6 +283,9 @@ class GitExtractor(GenericExtractor):
if not commit.rev:
# Query git for the abbreviated hash
commit.rev = do("git log -1 '--pretty=format:%h' " + shellquote(commit.commit))
+ if self.urlprefix in ('gitweb', 'cgit'):
+ # Also truncate the commit used for the announced urls
+ commit.commit = commit.rev
# Extract the meta-information for the commit
commit.files = do("git diff-tree -r --name-only " + shellquote(commit.commit))
commit.files = " ".join(commit.files.strip().split("\n")[1:])