summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-12-15 11:42:50 -0800
committerGerald Combs <gerald@wireshark.org>2016-12-15 19:46:37 +0000
commit2c20ffa871d39457ef3e10bef3e380e1c86e9661 (patch)
tree498ec4537e63949d98c07a52c298f33d01ded16c /tools
parent08a6925ced4fbf97ab679dcd4795d95fc78c19b3 (diff)
downloadwireshark-2c20ffa871d39457ef3e10bef3e380e1c86e9661.tar.gz
Update tools/commit-msg.
Update tools/commit-msg to version 2.12.7 by running curl -Lo tools/commit-msg https://code.wireshark.org/review/tools/hooks/commit-msg Change-Id: Ie70a8e869968b5237c9e21c0624f1f8af696d83b Reviewed-on: https://code.wireshark.org/review/19290 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/commit-msg20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/commit-msg b/tools/commit-msg
index 95a61e7806..1640d6ee24 100755
--- a/tools/commit-msg
+++ b/tools/commit-msg
@@ -1,7 +1,7 @@
#!/bin/sh
-# From Gerrit Code Review 2.9-rc1-172-gd621a9e
+# From Gerrit Code Review 2.12.7
#
-# Part of Gerrit Code Review (http://code.google.com/p/gerrit/)
+# Part of Gerrit Code Review (https://www.gerritcodereview.com/)
#
# Copyright (C) 2009 The Android Open Source Project
#
@@ -20,7 +20,7 @@
unset GREP_OPTIONS
-CHANGE_ID_AFTER="Bug|Issue"
+CHANGE_ID_AFTER="Bug|Issue|Test"
MSG="$1"
# Check for, and add if missing, a unique Change-Id
@@ -39,6 +39,12 @@ add_ChangeId() {
return
fi
+ # Do not add Change-Id to temp commits
+ if echo "$clean_message" | head -1 | grep -q '^\(fixup\|squash\)!'
+ then
+ return
+ fi
+
if test "false" = "`git config --bool --get gerrit.createChangeId`"
then
return
@@ -58,6 +64,10 @@ add_ChangeId() {
AWK=/usr/xpg4/bin/awk
fi
+ # Get core.commentChar from git config or use default symbol
+ commentChar=`git config --get core.commentChar`
+ commentChar=${commentChar:-#}
+
# How this works:
# - parse the commit message as (textLine+ blankLine*)*
# - assume textLine+ to be a footer until proven otherwise
@@ -76,8 +86,8 @@ add_ChangeId() {
blankLines = 0
}
- # Skip lines starting with "#" without any spaces before it.
- /^#/ { next }
+ # Skip lines starting with commentChar without any spaces before it.
+ /^'"$commentChar"'/ { next }
# Skip the line starting with the diff command and everything after it,
# up to the end of the file, assuming it is only patch data.