From 2c068a98e4b0bf54e7553ed7411fa8c7fe3173ba Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Sat, 23 Jul 2011 06:03:18 +0200 Subject: gerrit: add a dry-run mode to rfc script With DRY_RUN=1, rfc.sh will not perform the git push just display the push command. This can be useful if one wants to give a final review for the submitted change list (check for typos, misplaced bug id-s) or if one is offline. Change-Id: I90e2016ba78e2a0ecf37044b3db0277a25914f77 BUG: 3234 Reviewed-on: http://review.gluster.com/87 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- rfc.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'rfc.sh') diff --git a/rfc.sh b/rfc.sh index 8dad0afa..2a5e779c 100755 --- a/rfc.sh +++ b/rfc.sh @@ -94,10 +94,16 @@ function main() bug=$(git show --format='%b' | grep -i '^BUG: ' | awk '{print $2}'); + if [ "$DRY_RUN" = 1 ]; then + drier='echo -e Please use the following command to send your commits to review:\n\n' + else + drier= + fi + if [ -z "$bug" ]; then - git push origin HEAD:refs/for/$branch/rfc; + $drier git push origin HEAD:refs/for/$branch/rfc; else - git push origin HEAD:refs/for/$branch/bug-$bug; + $drier git push origin HEAD:refs/for/$branch/bug-$bug; fi } -- cgit