Created
February 28, 2014 20:40
-
-
Save reidbaker/9279430 to your computer and use it in GitHub Desktop.
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
## Gerrit is dumb ## | |
#################### | |
alias gerrit='ssh -p 29418 <wherever you run gerrit> gerrit' | |
# Usage # | |
# gerritIds <project> | |
# will list all change ids by you that are open for <project> | |
# useful to find what ids will will be abandoned by abandonALl | |
gerritIds() { | |
gerrit query --format=JSON --patch-sets -- status:open project:$1 | grep -v runTimeMilliseconds | grep -E "`git config user.email`" | grep -E -o '"number":"\d\d+"' | tr '"' ' ' | cut -d' ' -f4- | |
} | |
# Usage # | |
# abandonAll <project> | |
# will abandon all commits open with your email (as determined by git's user.email) for <project> | |
abandonAll() { | |
for i in `gerritIds $1`; do gerrit review --abandon $i,1; done ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment