File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 77{
88 echo " Usage: git gerrit init [-u <gerrit URL>] [-p <project name>]"
99 echo " git gerrit update [-b <target branch>]"
10- echo " git gerrit submit [-b <target branch>] [-d]"
10+ echo " git gerrit submit [-b <target branch>] [-d] [-t topic] "
1111 echo " git gerrit new"
1212 exit
1313}
@@ -140,7 +140,8 @@ gerrit_submit()
140140 # Determine target branch
141141 target=$( get_upstream)
142142 reffor=for
143- while getopts " b:d" OPTION
143+ unset topicspec
144+ while getopts " b:dt:" OPTION
144145 do
145146 case $OPTION in
146147 b)
@@ -150,6 +151,10 @@ gerrit_submit()
150151 reffor=drafts
151152 echo Submitting as DRAFT
152153 ;;
154+ t)
155+ topicspec=/$OPTARG
156+ echo Submitting with topic: $OPTARG
157+ ;;
153158 esac
154159 done
155160
218223 echo " Merge successful - please provide a meaningful commit message"
219224 echo
220225 git commit
221- git push gerrit HEAD:refs/${reffor} /$target
226+ git push gerrit HEAD:refs/${reffor} /${ target}${topicspec}
222227
223228 # Save commit message for next time, and switch back to working branch
224229 git log -1 --format=%B --no-color > $DATADIR /msg-$branchid
You can’t perform that action at this time.
0 commit comments