summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-10-21 11:08:25 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2013-10-28 21:31:42 +0100
commitb49dffad6911e4646159874d62d04188715bc350 (patch)
tree174b588cefcda2fb10dd0652a5335dea0d74aed7 /lib
parentf512003b9ffec176e67f79b362c87b405962f4e9 (diff)
lib/bpgit.py: enable extra arguments on git describe
Upstream commit: ea70308d746325654d44851be602fe02492b59f9 This lets us throw at it whatever extra stuff we want. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/bpgit.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/bpgit.py b/lib/bpgit.py
index 31b7de36..9a3f430b 100644
--- a/lib/bpgit.py
+++ b/lib/bpgit.py
@@ -27,8 +27,14 @@ def rev_parse(rev='HEAD', tree=None):
raise SHAError()
return sha
-def describe(rev='HEAD', tree=None):
- process = subprocess.Popen(['git', 'describe', '--always', '--long', rev],
+def describe(rev='HEAD', tree=None, extra_args=[]):
+ cmd = ['git', 'describe', '--always']
+
+ cmd.extend(extra_args)
+ if rev is not None:
+ cmd.append(rev)
+
+ process = subprocess.Popen(cmd,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
close_fds=True, universal_newlines=True, cwd=tree)
stdout = process.communicate()[0]