add ./logerrit resubmit
resubmit creates a new Change-Id for the current change and thus allow to submit changes for review on release branches that were already reviewed on master. Also hint advanced users to 'git review' which requires some more setup, but should make things easier for regular users. Getting this functionality into 'git review' would be likely help adoption too -- and in python there is some sane errorchecking possible. Change-Id: Ibea6bbfe747af160728b838c6ee236fd8f89671d
This commit is contained in:
parent
c2b467b84a
commit
4e15809a78
1 changed files with 37 additions and 22 deletions
59
logerrit
59
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
|
case "$1" in
|
||||||
help)
|
help)
|
||||||
echo "Usage: ./logerrit subcommand [options]"
|
echo "Usage: ./logerrit subcommand [options]"
|
||||||
|
echo "simple and basic tool to interact with LibreOffice gerrit"
|
||||||
echo "subcommands:"
|
echo "subcommands:"
|
||||||
echo " test test your gerrit setup"
|
echo " test test your gerrit setup"
|
||||||
echo " submit [BRANCH] submit your change for review to a branch"
|
echo " --- for submitters:"
|
||||||
echo " nextchange [BRANCH] reset branch to the remote to start with the next change"
|
echo " submit [BRANCH] submit your change for review"
|
||||||
echo " checkout CHANGEID checkout the changes for review"
|
echo " resubmit [BRANCH] create a new Change-Id and submit your change for review"
|
||||||
echo " pull CHANGEID pull (and merge) the changes on current branch"
|
echo " (yes, this modifies your last commit)"
|
||||||
echo " cherry-pick CHANGEID cherry-pick the change on current branch"
|
echo " nextchange [BRANCH] reset branch to the remote to start with the next change"
|
||||||
echo " patch CHANGEID show the change as a patch"
|
echo " --- for reviewers:"
|
||||||
echo " review [CHANGEID] interactively review a change (current one if no changeid given)"
|
echo " checkout CHANGEID checkout the changes for review"
|
||||||
echo " query .... query for changes for review on project core"
|
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 " <any other gerrit command>"
|
echo " <any other gerrit command>"
|
||||||
|
echo "advanced users should consider using git review instead:"
|
||||||
|
echo "http://wiki.documentfoundation.org/Development/GitReview"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
test)
|
test)
|
||||||
|
@ -58,20 +81,12 @@ case "$1" in
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
submit)
|
submit)
|
||||||
BRANCH=$2
|
submit $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
|
|
||||||
;;
|
;;
|
||||||
|
resubmit)
|
||||||
|
git log -1 --pretty=%B | grep -v ^Change-Id: | git commit --amend -F -
|
||||||
|
submit $2
|
||||||
|
;;
|
||||||
nextchange)
|
nextchange)
|
||||||
if test -n "`git status -s -uno`"
|
if test -n "`git status -s -uno`"
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue