Skip to content

Instantly share code, notes, and snippets.

@bcaudan
Last active August 29, 2015 14:19
Show Gist options
  • Save bcaudan/fa9b03bd93094620ece6 to your computer and use it in GitHub Desktop.
Save bcaudan/fa9b03bd93094620ece6 to your computer and use it in GitHub Desktop.
Push and send commits to Review Board. Install: add it in your path. Usage: git prv
#!/usr/bin/env bash
readonly CURRENT_BRANCH=$(git symbolic-ref HEAD | sed -e "s/^refs\/heads\///")
readonly COMMIT_REFS=($(git rev-list origin/$CURRENT_BRANCH..$CURRENT_BRANCH))
readonly GROUPS="Frontend"
post_reviews() {
for (( idx=${#COMMIT_REFS[@]}-1 ; idx>=0 ; idx-- )) ; do
rbt post -p --target-groups=${GROUPS} ${COMMIT_REFS[idx]}
done
}
main() {
git push
post_reviews
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment