You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
453 B
Python

#!/usr/bin/python
import re, os, subprocess
cwd = os.getcwd()
f = open("%s/.git/HEAD" % cwd, "r")
head = f.read()
branch = re.search("([^/]+)$", head).group(1).strip()
f = open("%s/.git/refs/heads/%s" % (cwd, branch), "r")
commit = f.read().strip()
result = subprocess.call(["%s/.git/hooks/post-commit-script" % cwd, commit, branch])
if result == 0:
print "Successfully reported commit to CIA.vc"
else:
print "Reporting commit to CIA.vc failed"