Created
September 26, 2013 17:02
-
-
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…
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 | |
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