public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Maxime Ripard <maxime.ripard@free-electrons.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: linux-next: bad commit in the sunxi tree
Date: Mon, 31 Oct 2016 13:59:53 +1100	[thread overview]
Message-ID: <8737jd2pg6.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20161027204137.ef6kxlzyvftcdomn@lukather>

Maxime Ripard <maxime.ripard@free-electrons.com> writes:
> On Thu, Oct 27, 2016 at 10:42:25AM +1100, Stephen Rothwell wrote:
>> On Tue, 25 Oct 2016 11:44:09 +0200 Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
>> > On Tue, Oct 25, 2016 at 09:22:55AM +1100, Stephen Rothwell wrote:
>> > > In today's sunxi tree
>> > > (git://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git#sunxi/for-next)
>> > > I noticed that commit
>> > > 
>> > >   3861b711f8b5 ("ARM: sun5i: chip: add a node for the w1 gpio controller")
>> > > 
>> > > has no Signed-off-by from its committer.  
>> > 
>> > Thanks, this has been fixed.
>> > 
>> > Just out of curiosity, what command do you run to catch this?
>> 
>> None :-)  I look at the differences in each tree as I fetch it and
>> just happen to notice some of these sometimes.  I should have a git
>> hook to check that there is a Signed-off-by for the author and
>> committer, but I would have to invest some time to figure out how :-)
>
> Ok, that's actually the real question I had in mind, if you had a hook
> I could use in order to avoid that kind of things in the future :)

I don't run a hook, but I have a separate script which does checks like
that. I've pulled out the Signed-off-by check into a script below, which
might work for you, or at least give you something to start from.

cheers


#!/bin/bash

function check_sob_by_committer
{
	local commit=$1

	git rev-parse --verify ${commit}^2 > /dev/null 2>&1
	if [[ $? -eq 0 ]]; then
		# It has at least 2 parents, ie. it's a merge
		# We don't sign off merges, so we're done
		return
	fi

	committer=$(git log -1 --format='%cn <%ce>' $commit)

	git log -1 --format=%b $commit | grep "Signed-off-by: $committer" > /dev/null
	if [[ $? -ne 0 ]]; then
		echo "  Not SOB committer '$committer'"
		return 1
	fi

	return 0
}

check_sob_by_committer $1
exit $?

  reply	other threads:[~2016-10-31  2:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 22:22 linux-next: bad commit in the sunxi tree Stephen Rothwell
2016-10-25  9:44 ` Maxime Ripard
2016-10-26 23:42   ` Stephen Rothwell
2016-10-27 20:41     ` Maxime Ripard
2016-10-31  2:59       ` Michael Ellerman [this message]
2016-10-31 14: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=8737jd2pg6.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.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