diff options
| author | Christopher Covington <cov@codeaurora.org> | 2014-04-03 17:49:31 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:21:15 -0400 |
| commit | 7ebd05ef1646e8cbef54e38343722741a4744626 (patch) | |
| tree | 1d00e5ffc3bd7d989a573b0dc9d92dbc9c71c686 /scripts | |
| parent | 74915c7dd0e144cc735058a77a3901c98f1e7039 (diff) | |
checkpatch.pl: add check for Change-Id
A commit hook for the Gerrit code review server [1] inserts change
identifiers so Gerrit can track patches through multiple revisions.
These identifiers are noise in the context of the upstream kernel.
(Many Gerrit servers are private. Even given a public instance, given
only a Change-Id, one must guess which server a change was tracked on.
Patches submitted to the Linux kernel mailing lists should be able to
stand on their own. If it's truly useful to reference code review on a
Gerrit server, a URL is a much clearer way to do so.) Thus, issue an
error when a Change-Id line is encountered before the Signed-off-by.
1. https://gerrit.googlesource.com/gerrit/+/master/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg
Signed-off-by: Christopher Covington <cov@codeaurora.org>
Cc: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d9b09eb767bb..fbb1b7e88e87 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -1924,6 +1924,12 @@ sub process { | |||
| 1924 | } | 1924 | } |
| 1925 | } | 1925 | } |
| 1926 | 1926 | ||
| 1927 | # Check for unwanted Gerrit info | ||
| 1928 | if ($in_commit_log && $line =~ /^\s*change-id:/i) { | ||
| 1929 | ERROR("GERRIT_CHANGE_ID", | ||
| 1930 | "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr); | ||
| 1931 | } | ||
| 1932 | |||
| 1927 | # Check for wrappage within a valid hunk of the file | 1933 | # Check for wrappage within a valid hunk of the file |
| 1928 | if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { | 1934 | if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { |
| 1929 | ERROR("CORRUPTED_PATCH", | 1935 | ERROR("CORRUPTED_PATCH", |
