linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@mellanox.com>
To: Joe Perches <joe@perches.com>
Cc: Matteo Croce <mcroce@redhat.com>,
	Doug Ledford <dledford@redhat.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Potnuri Bharat Teja <bharat@chelsio.com>
Subject: Re: linux-next: Fixes tag needs some work in the rdma-fixes tree
Date: Mon, 21 Oct 2019 17:39:25 +0000	[thread overview]
Message-ID: <20191021173921.GD6285@mellanox.com> (raw)
In-Reply-To: <d3a389360982c9d2730e6b29eb96523a562483ac.camel@perches.com>

On Mon, Oct 21, 2019 at 10:25:41AM -0700, Joe Perches wrote:
> On Mon, 2019-10-21 at 17:11 +0000, Jason Gunthorpe wrote:
> > On Mon, Oct 21, 2019 at 07:08:21PM +0200, Matteo Croce wrote:
> > > On Mon, Oct 21, 2019 at 7:01 PM Jason Gunthorpe <jgg@mellanox.com> wrote:
> > > > On Mon, Oct 21, 2019 at 05:39:06PM +0200, Matteo Croce wrote:
> > > > > > I thought I saw that checkpatch was checking this now?
> > > > > > 
> > > > > > commit a8dd86bf746256fbf68f82bc13356244c5ad8efa
> > > > > > Author: Matteo Croce <mcroce@redhat.com>
> > > > > > Date:   Wed Sep 25 16:46:38 2019 -0700
> > > > > > 
> > > > > >     checkpatch.pl: warn on invalid commit id
> > > > > > 
> > > > > > Maybe that check should also check that enough hash is provided and
> > > > > > other details like the correct subject line?
> > > > > > 
> > > > > > I also use a check that builds the fixes line from the commit id and
> > > > > > requires it to be the same as the patch provided. This catches all
> > > > > > sorts of wrong fixes lines, and sometimes git even recommends 13 chars
> > > > > > :\
> > > > > > 
> > > > > > Jason
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > actually I just call git_commit_info() which checks for validness.
> > > > > I could also check that the hash is at least 12 digits, would be very easy.
> > > > 
> > > > IMHO you should do
> > > > 
> > > >   git log --abbrev=12 -1 --format='Fixes: %h (\"%s\")'
> > > > 
> > > > And check that the provided fixes line matches the above output
> > > > exactly, or nearly exactly. People do lots of funny things to fixes
> > > > lines..
> > > > 
> > > 
> > > The point in using git_commit_info() instead of calling git directly
> > > is that the latter would generate an error if the working copy is not
> > > a git tree (e.g. a tar.xz downloaded from kernel.org).
> > 
> > Well, it does some checks and calls 'git log' so it seems like it
> > could learn to call git log with different arguments, right?
> 
> git commit SHA1's are not just 12 chars and could be any length.

--abbrev forces a minimum bound to the kernel recommendation if the
user has an old git or misconfigured git. git auto-detects if it needs
more digits beyond 12.

> And checkpatch already does use specific arguments
> 
> 	my $output = `${git_command} log --no-color --format='%H %s' -1 $commit 2>&1`;
> 
> and then parses that $output.

Maybe output format "%H %h %s" and then parse it to check the min
length and verify the subject?

Jason

  reply	other threads:[~2019-10-21 17:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21  7:41 linux-next: Fixes tag needs some work in the rdma-fixes tree Stephen Rothwell
2019-10-21 14:50 ` Doug Ledford
2019-10-21 15:15   ` Jason Gunthorpe
2019-10-21 15:39     ` Matteo Croce
2019-10-21 17:01       ` Jason Gunthorpe
2019-10-21 17:08         ` Matteo Croce
2019-10-21 17:11           ` Jason Gunthorpe
2019-10-21 17:25             ` Joe Perches
2019-10-21 17:39               ` Jason Gunthorpe [this message]
2019-10-21 19:32                 ` Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2024-02-05 22:03 Stephen Rothwell
2024-02-06 15:17 ` Jason Gunthorpe
2022-09-08 10:11 Stephen Rothwell
2019-04-22 20:57 Stephen Rothwell

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=20191021173921.GD6285@mellanox.com \
    --to=jgg@mellanox.com \
    --cc=bharat@chelsio.com \
    --cc=dledford@redhat.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mcroce@redhat.com \
    --cc=sfr@canb.auug.org.au \
    /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).