diff options
author | Neil <neil@dip.sun.ac.za> | 2016-03-14 13:24:03 +0200 |
---|---|---|
committer | Neil <neil@dip.sun.ac.za> | 2016-03-14 13:24:03 +0200 |
commit | 77a96a0e75068194905b1ffe6600729630efddcb (patch) | |
tree | ae52265a089ecd6b382167b6e3cab354daeffb06 | |
parent | Remove some irclib remnants. (diff) | |
download | irker-77a96a0e75068194905b1ffe6600729630efddcb.tar.xz |
Use git log to get the abbreviated hash
-rwxr-xr-x | irkerhook.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/irkerhook.py b/irkerhook.py index 33a4c52..5e7651a 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -281,7 +281,8 @@ class GitExtractor(GenericExtractor): else: # self.revformat == 'describe' commit.rev = do("git describe %s 2>/dev/null" % shellquote(commit.commit)) if not commit.rev: - commit.rev = commit.commit[:12] + # Query git for the abbreviated hash + commit.rev = do("git log -1 '--pretty=format:%h' " + shellquote(commit.commit)) # 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:]) |