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 7
7
{
8
8
echo " Usage: git gerrit init [-u <gerrit URL>] [-p <project name>]"
9
9
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] "
11
11
echo " git gerrit new"
12
12
exit
13
13
}
@@ -140,7 +140,8 @@ gerrit_submit()
140
140
# Determine target branch
141
141
target=$( get_upstream)
142
142
reffor=for
143
- while getopts " b:d" OPTION
143
+ unset topicspec
144
+ while getopts " b:dt:" OPTION
144
145
do
145
146
case $OPTION in
146
147
b)
@@ -150,6 +151,10 @@ gerrit_submit()
150
151
reffor=drafts
151
152
echo Submitting as DRAFT
152
153
;;
154
+ t)
155
+ topicspec=/$OPTARG
156
+ echo Submitting with topic: $OPTARG
157
+ ;;
153
158
esac
154
159
done
155
160
218
223
echo " Merge successful - please provide a meaningful commit message"
219
224
echo
220
225
git commit
221
- git push gerrit HEAD:refs/${reffor} /$target
226
+ git push gerrit HEAD:refs/${reffor} /${ target}${topicspec}
222
227
223
228
# Save commit message for next time, and switch back to working branch
224
229
git log -1 --format=%B --no-color > $DATADIR /msg-$branchid
You can’t perform that action at this time.
0 commit comments