Skip to content

Instantly share code, notes, and snippets.

@erikrose
Created September 26, 2013 17:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikrose/6717130 to your computer and use it in GitHub Desktop.
Save erikrose/6717130 to your computer and use it in GitHub Desktop.
I made myself a "git review" subcommand which takes a user:branch pair pasted from a pull request page, like abbeyj:macro-use-extents, and does the fetch and checkout to get me ready to try it out. It's like 2 lines, but it's remarkable the mental weight it lifts. I no longer dread reviews. Just stick it in a file called "git-review" (no extensi…
#!/usr/bin/env python
from subprocess import check_output
from sys import argv
def main():
user, branch = argv[1].split(':')
check_output('hub fetch %s' % user, shell=True)
check_output('git checkout %s/%s' % (user, branch), shell=True)
print 'Now reviewing %s:%s.' % (user, branch)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment