diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-21 11:08:25 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-21 21:50:38 +0200 |
commit | ea70308d746325654d44851be602fe02492b59f9 (patch) | |
tree | 49f31f54192ac7ba3fddd88762962e8cdbdd2fa6 /lib | |
parent | db67a3f06e3cbd0ac2196f7373e5e927fc1a866f (diff) |
lib/bpgit.py: enable extra arguments on git describe
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.py | 10 |
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] |