File: git.defs

package info (click to toggle)
jgit 6.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,052 kB
  • sloc: java: 265,941; xml: 6,543; sh: 334; ruby: 100; python: 20; makefile: 6
file content (9 lines) | stat: -rw-r--r-- 301 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
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