summaryrefslogtreecommitdiffstats
path: root/src/build/tools/verify-commit
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2013-04-08 15:37:09 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-04-09 17:00:28 -0500
commit7a30c775f5f6129e55b3f5c94efd72c114a9be87 (patch)
tree148cbe852867f00bb188ebe74d1c6e97327a8f0c /src/build/tools/verify-commit
parent9afea9f34838f35e1b4282362e2b6d51b9713eb5 (diff)
downloadtalos-hostboot-7a30c775f5f6129e55b3f5c94efd72c114a9be87.tar.gz
talos-hostboot-7a30c775f5f6129e55b3f5c94efd72c114a9be87.zip
verify-commit: Misc improvements.
- Fix line numbers in code. - Allow C++ :: token in commit messages as not a commit msg tag. Change-Id: I6f9ef6e09e3fac586ad87eac690074cb1eda32be Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3952 Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Tested-by: Jenkins Server Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/tools/verify-commit')
-rwxr-xr-xsrc/build/tools/verify-commit11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/build/tools/verify-commit b/src/build/tools/verify-commit
index 6341eb2c7..627f93c95 100755
--- a/src/build/tools/verify-commit
+++ b/src/build/tools/verify-commit
@@ -54,7 +54,8 @@ sub verifyPatchSet
# * Show only the lines changed, with no context (U0).
# Grep only the lines marked with "+" (instead of "-") to find just the
# actions done by this patchset and not the content removed.
- open PATCH_CONTENTS, "git diff HEAD~1 --diff-filter=AM -U0 | grep \"^+\" |";
+ open PATCH_CONTENTS, "git diff HEAD~1 --diff-filter=AM -U0 | ".
+ "grep -e \"^+\" -e \"^@@.*+[0-9]\\+\" |";
my %fileContents = ();
@@ -77,6 +78,12 @@ sub verifyPatchSet
}
$lastFile = $1;
}
+ # Lines starting with "@@" indicates a seek in the file, so update
+ # line numbers.
+ elsif ($line =~ m/^@@.*\+([0-9]+)/)
+ {
+ $lineCount = $1 - 1;
+ }
else
{
$line =~ s/^\+//; # filter off the leading + symbol.
@@ -244,7 +251,7 @@ sub verifyCommitMsg
# Identify if this is a tagged line or a non-tagged line and store
# away.
- if ($line =~ m/^\s*[A-Za-z0-9\-_]+:/)
+ if ($line =~ m/^\s*[A-Za-z0-9\-_]+:[^:]/)
{
# We allow lines that look like tags in the topic like...
# "FOO: Adding support for BAR."
OpenPOWER on IntegriCloud