mirror of
https://github.com/eclipse-jgit/jgit.git
synced 2024-08-30 05:58:19 +02:00
10 lines
301 B
Plaintext
10 lines
301 B
Plaintext
|
def git_version():
|
||
|
import subprocess
|
||
|
cmd = ['git', 'describe', '--always', '--match', 'v[0-9].*', '--dirty']
|
||
|
p = subprocess.Popen(cmd, stdout = subprocess.PIPE)
|
||
|
v = p.communicate()[0].strip()
|
||
|
r = p.returncode
|
||
|
if r != 0:
|
||
|
raise subprocess.CalledProcessError(r, ' '.join(cmd))
|
||
|
return v
|