From: Stephen Rothwell <sfr@canb.auug.org.au>
To: David Miller <davem@davemloft.net>
Cc: sd@queasysnail.net, andrew@lunn.ch, hkallweit1@gmail.com,
netdev@vger.kernel.org, linux-next@vger.kernel.org,
linux-kernel@vger.kernel.org, f.fainelli@gmail.com
Subject: Re: linux-next: Signed-off-by missing for commits in the net-next tree
Date: Mon, 10 Dec 2018 11:48:48 +1100 [thread overview]
Message-ID: <20181210114848.3f726482@canb.auug.org.au> (raw)
In-Reply-To: <20181209.163152.1641648923109797638.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 2345 bytes --]
Hi Dave,
On Sun, 09 Dec 2018 16:31:52 -0800 (PST) David Miller <davem@davemloft.net> wrote:
>
> From: Sabrina Dubroca <sd@queasysnail.net>
> Date: Mon, 10 Dec 2018 00:27:22 +0100
>
> > Maybe Stephen's script to detect those missing sign-offs could be run
> > as a commit/apply hook by David? This happens regularly, sometimes
> > dropping more than just a sign-off.
>
> Yeah, that would probably be a good idea, maybe something even on the
> git.kernel.org side that won't let me push if I'm sending commits that
> have this problem.
That is fine as a last resort, but it is probably less disruptive to
find these things before you try to push i.e. as part of the "apply the
patch" otherwise you could end up having to rebase a whole lot of later
commits.
Anyway, here's my current version of my script. It just takes a commit
range (anything you can pass to "git log"). You may want to drop the
gitk invocation at the end.
--------------------------------------------------------------------
#!/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
exec gitk "$@"
--------------------------------------------------------------------
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-12-10 0:48 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-09 21:00 linux-next: Signed-off-by missing for commits in the net-next tree Stephen Rothwell
2018-12-09 21:11 ` Andrew Lunn
2018-12-09 21:33 ` Heiner Kallweit
2018-12-09 21:49 ` Andrew Lunn
2018-12-09 23:27 ` Sabrina Dubroca
2018-12-10 0:31 ` David Miller
2018-12-10 0:48 ` Stephen Rothwell [this message]
2018-12-10 0:54 ` David Miller
2018-12-10 2:05 ` Stephen Rothwell
2018-12-10 0:28 ` David Miller
2018-12-10 13:35 ` Andrew Lunn
2018-12-10 13:55 ` Sabrina Dubroca
2018-12-10 0:27 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2022-03-06 20:22 Stephen Rothwell
2022-03-07 23:02 ` Jakub Kicinski
2022-03-07 23:19 ` Stephen Rothwell
2022-03-07 23:24 ` Jakub Kicinski
2022-01-26 20:57 Stephen Rothwell
2022-01-26 22:50 ` Russell King (Oracle)
2021-08-21 3:08 Stephen Rothwell
2021-08-21 6:37 ` Sven Eckelmann
2020-03-10 10:01 Stephen Rothwell
2020-03-10 23:57 ` Saeed Mahameed
2020-04-13 0:05 ` Stephen Rothwell
2020-04-16 1:58 ` Saeed Mahameed
2019-11-25 7:28 Stephen Rothwell
2019-11-25 7:35 ` Daniel Borkmann
2019-08-15 21:53 Stephen Rothwell
2019-08-15 22:06 ` Gerd Rausch
2019-08-16 9:15 ` Andy Grover
2019-08-16 12:45 ` Chris Mason
2019-08-16 14:10 ` Gerd Rausch
2019-08-16 14:31 ` Stephen Rothwell
2018-10-19 7:30 Stephen Rothwell
2018-04-02 2:30 Stephen Rothwell
2018-04-02 5:38 ` Johan Hedberg
2018-04-02 6:50 ` Stephen Rothwell
2018-03-02 4:52 Stephen Rothwell
2017-12-18 20:41 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=20181210114848.3f726482@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sd@queasysnail.net \
/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).