Created
May 14, 2013 07:14
-
-
Save inetfuture/5574234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
LOG_FILENAME = '/var/log/git-hook-post-receive.log' | |
from datetime import datetime | |
if __name__ == '__main__': | |
try: | |
from sys import stdin | |
prev_sha, new_sha, ref = stdin.readline().split() | |
commit_branch = ref.replace('refs/heads/', '') | |
# Do the job. | |
except Exception as cause: | |
with open(LOG_FILENAME, 'a') as log: | |
log.write('%s %s\n' % (datetime.now(), cause)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment