Skip to content

Instantly share code, notes, and snippets.

@victor
Created August 28, 2012 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victor/3497546 to your computer and use it in GitHub Desktop.
Save victor/3497546 to your computer and use it in GitHub Desktop.
If you use gerrit for code review, this script may come in handy. Substitute your repository name adequately
#!/bin/sh
PATCH=$1
PATCHSET=$2
URL=ssh://username@server:29418/repository
if [ -z "$PATCHSET" ]; then
PATCHSET=1
fi
git fetch ${URL} refs/changes/${PATCH:2}/${PATCH}/${PATCHSET} && git checkout -B "${PATCH}#${PATCHSET}" FETCH_HEAD
@josealobato
Copy link

Nice. No more copy paste from Gerrit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment