-
-
Save scottrogowski/398ea7e3d5b231b817c5 to your computer and use it in GitHub Desktop.
Set a note on the current git branch using command line arguments
This file contains hidden or 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 | |
# Set a note on the current git branch using command line arguments | |
# Usage: note this branch is broken | |
import sys | |
import subprocess | |
import json | |
if __name__ == '__main__': | |
branch = subprocess.check_output("git rev-parse --abbrev-ref HEAD".split()).strip() | |
note = ' '.join(sys.argv[1:]) | |
cmd = "git config branch.%s.note" % (branch) | |
subprocess.check_output(cmd.split() + [note]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment