Skip to content

Instantly share code, notes, and snippets.

@scottrogowski
Created March 26, 2015 16:01

Revisions

  1. scottrogowski created this gist Mar 26, 2015.
    14 changes: 14 additions & 0 deletions note
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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])