Skip to content

Commit 2a4a1fd

Browse files
committed
Add -q (quiet) option to 'git gerrit submit'
-q will skip editing the commit message.
1 parent ded86b4 commit 2a4a1fd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

git-gerrit

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ usage()
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] [-t topic]"
10+
echo " git gerrit submit [-b <target branch>] [-d] [-t topic] [-q]"
1111
echo " git gerrit new"
1212
exit
1313
}
@@ -140,8 +140,8 @@ gerrit_submit()
140140
# Determine target branch
141141
target=$(get_upstream)
142142
reffor=for
143-
unset topicspec
144-
while getopts "b:dt:" OPTION
143+
unset topicspec commitargs
144+
while getopts "b:dt:q" OPTION
145145
do
146146
case $OPTION in
147147
b)
@@ -155,6 +155,10 @@ gerrit_submit()
155155
topicspec=/$OPTARG
156156
echo Submitting with topic: $OPTARG
157157
;;
158+
q)
159+
commitargs="$commitargs --no-edit"
160+
echo Will skip EDITOR for commit message
161+
;;
158162
esac
159163
done
160164

@@ -222,7 +226,7 @@ EOF
222226
echo
223227
echo "Merge successful - please provide a meaningful commit message"
224228
echo
225-
git commit
229+
git commit ${commitargs}
226230
git push gerrit HEAD:refs/${reffor}/${target}${topicspec}
227231

228232
# Save commit message for next time, and switch back to working branch

0 commit comments

Comments
 (0)