From 4322cdab98bcd4a51c121278944c90a497292b62 Mon Sep 17 00:00:00 2001 From: Ilmari Lauhakangas Date: Mon, 6 Jan 2020 14:28:40 +0200 Subject: logerrit: support submitting private and wip changes Change-Id: I0ee3ac887e17b38b6a2c501bcf6a2132406f1d20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86273 Reviewed-by: Guilhem Moulin Tested-by: Jenkins Reviewed-by: Mike Kaganski --- logerrit | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'logerrit') diff --git a/logerrit b/logerrit index 736e4342959b..33f45dc44c73 100755 --- a/logerrit +++ b/logerrit @@ -9,8 +9,8 @@ get_SHA_for_change() { } submit() { - TYPE=$1 - BRANCH=$2 + BRANCH=$1 + TYPE=${2:-''} if test -z "$BRANCH" then BRANCH=$(git symbolic-ref HEAD 2> /dev/null) @@ -22,7 +22,7 @@ submit() { fi echo "no branch specified, guessing current branch $BRANCH" fi - git push $GERRITURL HEAD:refs/$TYPE/$BRANCH + git push $GERRITURL HEAD:refs/for/$BRANCH$TYPE } logerrit() { @@ -45,10 +45,12 @@ case "$1" in echo echo " --- for submitters:" echo " submit [BRANCH] submit your change for review" - echo " submit-draft [BRANCH] submit your change as draft" + echo " submit-private [BRANCH] submit your change as private" + echo " submit-wip [BRANCH] submit your change as work-in-progress" echo " nextchange [BRANCH] reset branch to the remote to start with the next change" echo " testfeature [BRANCH] trigger a test of a feature branch on gerrit" - echo "Note: drafts are only visibly to yourself and those that you explicitly add as reviewers." + echo "Note: private changes are only visibly to yourself and those that you explicitly add as reviewers." + echo "For full documentation, see https://gerrit.libreoffice.org/Documentation/intro-user.html#private-changes" echo echo " --- for reviewers:" echo " checkout CHANGEID checkout the changes for review" @@ -134,10 +136,17 @@ case "$1" in fi ;; submit) - submit 'for' $2 + submit $2 + ;; + submit-private) + submit $2 '%private' + ;; + submit-wip) + submit $2 '%wip' ;; submit-draft) - submit drafts $2 + echo "Please use submit-private instead of submit-draft." + exit 1 ;; nextchange) if test -n "$(git status -s -uno)" -- cgit