]> scripts.mit.edu Git - wizard.git/blob - wizard/git.py
d98f757799d22b6ff6374ae7026fe213162445fa
[wizard.git] / wizard / git.py
1 """
2 Helper functions for dealing with Git.
3 """
4
5 from wizard import shell, util
6
7 def describe():
8     """Finds the output of git describe --tags of the current directory."""
9     return shell.Shell().safeCall("git", "describe", "--tags", strip=True)
10
11 def commit_configure():
12     message = "Autoinstall configuration of %s locker.\n\n%s" % (util.get_dir_owner(), util.get_git_footer())
13     util.set_git_env()
14     try:
15         message += "\nConfigured-by: " + util.get_operator_git()
16     except util.NoOperatorInfo:
17         pass
18     shell.Shell().call("git", "commit", "--allow-empty", "-a", "-m", message)