mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Palmer Dabbelt <palmer@dabbelt.com>, linux-kernel@vger.kernel.org
Cc: apw@canonical.com, dwaipayanray1@gmail.com,
	lukas.bulwahn@gmail.com, kernel-team@android.com,
	Palmer Dabbelt <palmerdabbelt@google.com>
Subject: Re: [PATCH] checkpatch: Don't show signatures in git-log
Date: Tue, 06 Jul 2021 19:03:45 -0700	[thread overview]
Message-ID: <b1b103f7ede65a2a31054bba817fec858d749129.camel@perches.com> (raw)
In-Reply-To: <20210706223029.2377293-1-palmer@dabbelt.com>

On Tue, 2021-07-06 at 15:30 -0700, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> I have git-log setup to show signatures.  I've recently noticed this
> breaking checkpatch error messages, which show something like
> 
>     ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit gpg: Signatu (":05 PM PDT")'
>     #8:
>     the module region by 3a02764c372c ("riscv: Ensure BPF_JIT_REGION_START
> 
> instead of something more helpful, like
> 
>     ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 3a02764c372c ("riscv: Ensure BPF_JIT_REGION_START aligned with PMD size")'
>     #8:
>     the module region by 3a02764c372c ("riscv: Ensure BPF_JIT_REGION_START
> 
> which shows up with this patch.  I'm not sure if these just started
> showing up for if I just noticed them or if they've been around forever.
> 
> I've only found it necessary to add --no-show-signature to the git-log
> invocation in git_commit_info(), but a cursory glance indicates that the
> other two invocations may suffer from similar problems so I've just
> added it everywhere.

Perhaps this should be in some standardized $git_log_options argument
so that if there are more of these no-<foo> that need to be added, like
for instance, --no-notes, it'd be easier to add everywhere.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -1103,7 +1103,7 @@ sub seed_camelcase_includes {
>  	$camelcase_seeded = 1;

somwhere above:

our $git_log_no_opts = '--no-show-signature --no-color"

> 
>  	if (-e "$gitroot") {
> -		my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`;
> +		my $git_last_include_commit = `${git_command} log --no-show-signature --no-merges --pretty=format:"%h%n" -1 -- include`;

So this could be:

		my $git_last_include_commit = `${git_command} log $git_log_no_opts --no-merges --pretty=format:"%h%n" -1 -- include`;

>  		chomp $git_last_include_commit;
>  		$camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit";
>  	} else {
> @@ -1165,7 +1165,7 @@ sub git_commit_info {
>  
>  	return ($id, $desc) if ((which("git") eq "") || !(-e "$gitroot"));
>  
> 
> -	my $output = `${git_command} log --no-color --format='%H %s' -1 $commit 2>&1`;
> +	my $output = `${git_command} log --no-color --no-show-signature --format='%H %s' -1 $commit 2>&1`;

	my $output = `${git_command} log $git_log_no_opts --format='%H %s' -1 $commit 2>&1`;

etc...

>  	$output =~ s/^\s*//gm;
>  	my @lines = split("\n", $output);
> 
> @@ -1215,7 +1215,7 @@ if ($git) {
>  		} else {
>  			$git_range = "-1 $commit_expr";
>  		}
> -		my $lines = `${git_command} log --no-color --no-merges --pretty=format:'%H %s' $git_range`;
> +		my $lines = `${git_command} log --no-show-signature --no-color --no-merges --pretty=format:'%H %s' $git_range`;

		my $lines = `${git_command} log $git_log_no_opts --no-merges --pretty=format:'%H %s' $git_range`;

>  		foreach my $line (split(/\n/, $lines)) {
>  			$line =~ /^([0-9a-fA-F]{40,40}) (.*)$/;
>  			next if (!defined($1) || !defined($2));



      reply	other threads:[~2021-07-07  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06 22:30 Palmer Dabbelt
2021-07-07  2:03 ` Joe Perches [this message]

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=b1b103f7ede65a2a31054bba817fec858d749129.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=palmerdabbelt@google.com \
    /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

all inboxes | Powered by JetHome®