Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorShawn Pearce2016-01-03 17:30:16 +0000
committerShawn Pearce2016-01-03 17:30:16 +0000
commit776c3003aa0f6d66f222c2d74d86a59cf9f8fe98 (patch)
treecb1a72fbeb52a2c1f2673b88ccbb1d8d43684cce /tools
parentda3174a812d07b03dd0738f572e187412911e925 (diff)
downloadjgit-776c3003aa0f6d66f222c2d74d86a59cf9f8fe98.tar.gz
jgit-776c3003aa0f6d66f222c2d74d86a59cf9f8fe98.tar.xz
jgit-776c3003aa0f6d66f222c2d74d86a59cf9f8fe98.zip
buck: set Bundle-Version for :jgit_bin
Run git describe during the build to determine the lineage of this working directory and stamp this information into the binary. Change-Id: I0ad24125c31e4280ccf900bac4065924087b05aa
Diffstat (limited to 'tools')
-rw-r--r--tools/git.defs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/git.defs b/tools/git.defs
new file mode 100644
index 0000000000..557dff2319
--- /dev/null
+++ b/tools/git.defs
@@ -0,0 +1,9 @@
+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

Back to the top