From: Joe Perches <joe@perches.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/1] checkpatch: check for subject uniqueness in git repository.
Date: Mon, 15 Sep 2014 14:02:04 -0700 [thread overview]
Message-ID: <1410814924.18787.37.camel@joe-AO725> (raw)
In-Reply-To: <1410806637-3510-1-git-send-email-fabf@skynet.be>
On Mon, 2014-09-15 at 20:43 +0200, Fabian Frederick wrote:
> Adding patch subject uniqueness check in checkpatch --strict mode.
> See Documentation/SubmittingPatches/globally-unique identifier.
I'm not sold on the concept as I'm not sure that
global subject uniqueness is all that important.
There are many "update defconfig" type patches that
have identical subjects. There really isn't a need
to have more information or add a numeric sequence #
to a subject like that.
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> +# Check patch subject on subjective/strict check mode
> + if ($check && $line =~ /^Subject: \[(.*)\](.*)/) {
> + my $subject = $2;
> + if ($quiet == 0) {
> + print "Looking for patches with the same subject in git repository ...\n";
> + }
> + $git_samesubjects = `git log --oneline | grep -m1 "$subject\$" | wc -l`;
checkpatch doesn't require a git repository to be
successfully used.
Please add a new function, something like the existing
"sub git_commit_info", for this so that if git is not
installed, there will not be a runtime failure.
Store the output in a perl array and use perl's grep
mechanism rather than the grep command line tool.
This will be _very_ slow.
On my computer with an ssd it takes > 20 seconds
just to do:
$ git --no-pager log --nocolor --no-merges --format='%H %s'
fyi: there are already > ~3500 commits with duplicate titles.
This will not find duplicate titles in a patch series unless
the patches were created with git and the current branch is
the same one that was used to create the series.
$ git checkout -b <name>
while (more changes to make) {
[ modify / compile / test]
$ git commit ...
}
$ git format-patch -o <dir> --cover-letter master
$ git checkout master
$ ./scripts/checkpatch.pl <dir>/*
No problem would be found...
Now for a patch series, it would be useful/better to scan
directories for patches with duplicate titles using
something like:
$ ./scripts/checkpatch.pl <dir>/*.patch
and compare the "^Subject:" lines for duplicates without
using git at all.
> @@ -5091,6 +5101,10 @@ sub process {
> ERROR("MISSING_SIGN_OFF",
> "Missing Signed-off-by: line(s)\n");
> }
> + if ($is_patch && $git_samesubjects > 0) {
> + WARN("NOT_UNIQUE_SUBJECT",
> + "similar subjects found in git repository\n");
s/similar subjects/identical patch subjects/
next prev parent reply other threads:[~2014-09-15 21:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-15 18:43 [PATCH 1/1] checkpatch: check for subject uniqueness in git repository Fabian Frederick
2014-09-15 21:02 ` Joe Perches [this message]
2014-09-16 3:22 ` Joe Perches
2014-09-16 16:15 ` Fabian Frederick
2014-09-16 16:31 ` Joe Perches
2014-09-20 10:31 ` Fabian Frederick
2014-09-20 16:07 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1410814924.18787.37.camel@joe-AO725 \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).