Skip to content

Instantly share code, notes, and snippets.

@edeno
Created February 8, 2017 20:14
Show Gist options
  • Save edeno/e225d8e4ba3066615bcebaed5bcc7bb3 to your computer and use it in GitHub Desktop.
Save edeno/e225d8e4ba3066615bcebaed5bcc7bb3 to your computer and use it in GitHub Desktop.
Record the git hash of your current run for log files
from subprocess import PIPE, run
print(run(['git', 'rev-parse', 'HEAD'],
stdout=PIPE, universal_newlines=True).stdout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment