mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: Validate Fixes: tag using 'commit' checks
Date: Sat, 31 Aug 2019 11:39:39 +1000	[thread overview]
Message-ID: <20190831113939.7c2dad32@canb.auug.org.au> (raw)
In-Reply-To: <20190830163658.17043-1-sean.j.christopherson@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]

Hi Sean,

On Fri, 30 Aug 2019 09:36:58 -0700 Sean Christopherson <sean.j.christopherson@intel.com> wrote:
>
> @@ -2803,10 +2805,15 @@ sub process {
>  			($id, $description) = git_commit_info($orig_commit,
>  							      $id, $orig_desc);
>  
> -			if (defined($id) &&
> -			   ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens)) {
> +
> +			if (!defined($id)) {
> +				if ($init_tag =~ /fixes:/i) {
> +					ERROR("GIT_COMMIT_ID",
> +					      "Target SHA1 '$orig_commit' does not exist\n" . $herecurr);
> +				}

Unfortunately, git_commit_info() just returns the passed in $id (which
is explicitly set earlier) if git is not available or you are not in a
git repository (and that latter check is not entirely correct anyway).

Also, what you really need to test is if the specified commit is an
ancestor of the place in the maintainer's tree where this patch is to
be applied.  The commit may well exist in the developer's tree, but not
be in the maintainer's tree :-(

This will, however, catch the cases where the SHA1 has been mistyped,
but we should encourage people not to type them anyway, instead
generating them using "git log".

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-08-31  1:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 16:36 Sean Christopherson
2019-08-31  1:39 ` Stephen Rothwell [this message]
2019-09-03 15:58   ` Sean Christopherson

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=20190831113939.7c2dad32@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sean.j.christopherson@intel.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®