From a8023a07809fffcddb345c0aec517ed11f525151 Mon Sep 17 00:00:00 2001 From: Michael Herman Date: Sat, 3 Jan 2015 15:13:57 -0700 Subject: [PATCH] updated readme, added git tag script --- 22_git_tag.py | 14 ++++++++++++++ readme.md | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 22_git_tag.py diff --git a/22_git_tag.py b/22_git_tag.py new file mode 100644 index 0000000..283f495 --- /dev/null +++ b/22_git_tag.py @@ -0,0 +1,14 @@ +import subprocess +import sys + + +if len(sys.argv) == 3: + tag = sys.argv[1] + commit = sys.argv[2] + command = 'git tag -a {0} {1} -m "{2}"'.format(tag, commit, tag) + output = subprocess.check_output(command, shell=True).decode('utf-8') + subprocess.call(command, shell=True) + subprocess.call('git push --tags', shell=True) +else: + print 'usage: tag.py TAG_NAME COMMIT' + sys.exit(1) diff --git a/readme.md b/readme.md index ee46cd8..711370b 100644 --- a/readme.md +++ b/readme.md @@ -19,4 +19,6 @@ 1. **17_rewrite_git_history.md**: Backdating/Rewriting Git history (use at your own risk) 1. **18_zipper.py**: Zip contents of a directory, adding a timestamp to the filename 1. **19_tsv-to-csv.py**: Convert TSV to CSV -1. **20_restore_file_from_git.py**: Restore file from Git History \ No newline at end of file +1. **20_restore_file_from_git.py**: Restore file from Git History +1. **21_twitter_bot.py**: Twitter Bot +1. **22_git_tag.py**: Create Git Tag based on a commit \ No newline at end of file