lkml.org 
[lkml]   [2019]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] checkpatch: Validate Fixes: tag using 'commit' checks
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-08-31 03:41    [W:0.071 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site