linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: "Andreas Grünbacher" <andreas.gruenbacher@gmail.com>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	Steven Whitehouse <swhiteho@redhat.com>,
	Bob Peterson <rpeterso@redhat.com>,
	Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andreas Gruenbacher <agruenba@redhat.com>
Subject: Re: linux-next: Signed-off-by missing for commit in the gfs2 tree
Date: Wed, 12 Dec 2018 09:51:07 +1100	[thread overview]
Message-ID: <20181212095107.5e35982a@canb.auug.org.au> (raw)
In-Reply-To: <CAHpGcM+wCSrj0pk89ZoMENp+L_zSXbSFhEJcsdDEOh1F-GmGvg@mail.gmail.com>

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

Hi Andreas,

On Tue, 11 Dec 2018 21:47:43 +0100 Andreas Grünbacher <andreas.gruenbacher@gmail.com> wrote:
>
> Yep, I've not asked for a way to get the server to reject or warn
> about such pushes without a reason.

Sure, but also here's the script I run (which could be run before
pushing) ...

----------------------------------------------------------------------
#!/bin/bash

if [ "$#" -lt 1 ]; then
	printf "Usage: %s <commit range>\n", "$0" 1>&2
	exit 1
fi

commits=$(git rev-list --no-merges "$@")
if [ -z "$commits" ]; then
	printf "No commits\n"
	exit 0
fi

author_missing=
committer_missing=

print_commits()
{
	local t="$1"

	shift

	s=
	is='is'
	its='its'
	[ "$#" -gt 1 ] && {
		s='s'
		is='are'
		its='their'
	}
	printf "Commit%s\n\n" "$s"
	git log --no-walk --pretty='format:  %h ("%s")' "$@"
	printf "\n%s missing a Signed-off-by from %s %s%s.\n" "$is" "$its" "$t" "$s"
	printf "\n"
}

for c in $commits; do
	ae=$(git log -1 --format='<%ae>%n<%aE>%n %an %n %aN ' "$c" | sort -u)
	ce=$(git log -1 --format='<%ce>%n<%cE>%n %cn %n %cN ' "$c" | sort -u)
	msg=$(git log -1 --format='%b' "$c")
	sob=$(echo "$msg" | sed -En 's/^\s*Signed-off-by:?\s*/ /ip')

	am=false
	cm=false
	grep -i -F -q "$ae" <<<"$sob" ||
		am=true
	grep -i -F -q "$ce" <<<"$sob" ||
		cm=true
	"$am" && author_missing+=" $c"
	"$cm" && committer_missing+=" $c"
done

if [ "$author_missing" ]; then
	print_commits "author" $author_missing
fi
if [ "$committer_missing" ]; then
	print_commits "committer" $committer_missing
fi
----------------------------------------------------------------------

-- 
Cheers,
Stephen Rothwell

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

  reply	other threads:[~2018-12-11 22:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 20:24 linux-next: Signed-off-by missing for commit in the gfs2 tree Stephen Rothwell
2018-12-11 20:38 ` Stephen Rothwell
2018-12-11 20:47   ` Andreas Grünbacher
2018-12-11 22:51     ` Stephen Rothwell [this message]
2018-12-12 15:46     ` Konstantin Ryabitsev
  -- strict thread matches above, loose matches on Subject: below --
2023-12-21 21:33 Stephen Rothwell
2023-08-17 22:50 Stephen Rothwell
2023-08-14 22:55 Stephen Rothwell
2023-06-29 22:02 Stephen Rothwell
2023-01-31 21:37 Stephen Rothwell
2022-06-23 23:37 Stephen Rothwell
2022-06-02 22:12 Stephen Rothwell
2022-03-27 21:17 Stephen Rothwell
2022-02-13 10:52 Stephen Rothwell
2021-11-06  2:08 Stephen Rothwell
2021-01-24  9:50 Stephen Rothwell
2020-12-29 20:22 Stephen Rothwell
2020-10-20 20:35 Stephen Rothwell
2020-09-20 20:09 Stephen Rothwell
2020-09-16 21:31 Stephen Rothwell
2020-05-10 20:53 Stephen Rothwell
2020-04-15 21:53 Stephen Rothwell
2019-05-07 21:36 Stephen Rothwell
2018-11-15 22:19 Stephen Rothwell
2018-10-08 20:54 Stephen Rothwell
2018-10-09 12:11 ` Bob Peterson
2018-07-24 22:01 Stephen Rothwell
2018-07-24 22:23 ` Andreas Grünbacher
2018-07-25  1:16   ` Stephen Rothwell
2018-01-16 20:51 Stephen Rothwell
2018-01-17  9:36 ` Steven Whitehouse
2018-01-17 14:46   ` Bob Peterson

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=20181212095107.5e35982a@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=agruenba@redhat.com \
    --cc=andreas.gruenbacher@gmail.com \
    --cc=konstantin@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rpeterso@redhat.com \
    --cc=swhiteho@redhat.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;
as well as URLs for NNTP newsgroup(s).