diff --git a/logerrit b/logerrit index 05346d96e00f..6585db1d8fe3 100755 --- a/logerrit +++ b/logerrit @@ -31,20 +31,43 @@ ask_tristate() { } +submit() { + BRANCH=$1 + if test -z "$BRANCH" + then + BRANCH=`git symbolic-ref HEAD 2> /dev/null` + BRANCH="${BRANCH##refs/heads/}" + if test -z "$BRANCH" + then + echo "no branch specified, and could not guess the current branch" + exit 1 + fi + echo "no branch specified, guessing current branch $BRANCH" + fi + git push $GERRITURL HEAD:refs/for/$BRANCH +} + case "$1" in help) echo "Usage: ./logerrit subcommand [options]" + echo "simple and basic tool to interact with LibreOffice gerrit" echo "subcommands:" - echo " test test your gerrit setup" - echo " submit [BRANCH] submit your change for review to a branch" - echo " nextchange [BRANCH] reset branch to the remote to start with the next change" - echo " checkout CHANGEID checkout the changes for review" - echo " pull CHANGEID pull (and merge) the changes on current branch" - echo " cherry-pick CHANGEID cherry-pick the change on current branch" - echo " patch CHANGEID show the change as a patch" - echo " review [CHANGEID] interactively review a change (current one if no changeid given)" - echo " query .... query for changes for review on project core" + echo " test test your gerrit setup" + echo " --- for submitters:" + echo " submit [BRANCH] submit your change for review" + echo " resubmit [BRANCH] create a new Change-Id and submit your change for review" + echo " (yes, this modifies your last commit)" + echo " nextchange [BRANCH] reset branch to the remote to start with the next change" + echo " --- for reviewers:" + echo " checkout CHANGEID checkout the changes for review" + echo " pull CHANGEID pull (and merge) the changes on current branch" + echo " cherry-pick CHANGEID cherry-pick the change on current branch" + echo " patch CHANGEID show the change as a patch" + echo " review [CHANGEID] interactively review a change (current one if no changeid given)" + echo " query .... query for changes for review on project core" echo " " + echo "advanced users should consider using git review instead:" + echo "http://wiki.documentfoundation.org/Development/GitReview" exit ;; test) @@ -58,20 +81,12 @@ case "$1" in fi ;; submit) - BRANCH=$2 - if test -z "$BRANCH" - then - BRANCH=`git symbolic-ref HEAD 2> /dev/null` - BRANCH="${BRANCH##refs/heads/}" - if test -z "$BRANCH" - then - echo "no branch specified, and could not guess the current branch" - exit 1 - fi - echo "no branch specified, guessing current branch $BRANCH" - fi - git push $GERRITURL HEAD:refs/for/$BRANCH + submit $2 ;; + resubmit) + git log -1 --pretty=%B | grep -v ^Change-Id: | git commit --amend -F - + submit $2 + ;; nextchange) if test -n "`git status -s -uno`" then