[lkml]   [2011]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [git patches] libata updates, GPG signed (but see admin notes)
On Mon, Oct 31, 2011 at 1:19 AM, James Bottomley
<> wrote:
>> That said, even the "BEGIN PGP SIGNED MESSAGE" things are a massive
>> pain in the butt. We need to automate this some sane way, both for the
>> sender and for the recipient.
> But this doesn't help with what practise you want us to follow.  Do you
> want us to send full signed email using pgp encapsulation for pull
> requests in spite of the mangling it does to attached patches and the
> amount of extra pain it causes you?

No. I don't want the *whole* email signed, because that is quite
inconvenient: it means that I can't just cut-and-paste some signature,
I have to save the email and verify it etc etc.

So my preferred thing would literally be to make the signed part as
small as possible with no odd characters or whitespace (top commit and
probably repository name), so that I can cut-and-paste it and just
have a terminal window open with "gpg --verify + paste + ^D" and I'm

For the people who use "git request-pull", I'm attaching a trivial
patch to make it add this kind of signature if you give it the "-s"
flag. It basically just adds a hunk like the appended crazy example to
the pull request, and it's small enough and simple enough that it
makes verification simple too with just the above kind of trivial
cut-and-paste thing.

(Junio cc'd, I think he had something more complicated in mind)

Now, admittedly it would be *even nicer* if this gpg-signed block was
instead uploaded as a signed tag automatically, and "git pull" would
notice such a signed tag (tagname the same as the branch name + date
or something) and would download and verify the tag as I pull. Then I
wouldn't even need to actually do the cut-and-paste at all. But this
is the *really* simple approach that gets up 95% of the way there.

And the attached patch is so trivial that if you aren't actually using
"git request-pull" but instead have some home-cooked script to do the
same, then you can just look at this patch and trivially change your
script to do something very similar.


[ Example gpg-signed small block that the attached patch adds to the
pull request: ]

Hash: SHA1

Commit be3fa9125e708348c7baf04ebe9507a72a9d1800
Version: GnuPG v2.0.18 (GNU/Linux)

-----END PGP SIGNATURE----- | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ b/
index fc080cc5e45d..22b51930959f 100755
--- a/
+++ b/
@@ -20,11 +20,14 @@ GIT_PAGER=
export GIT_PAGER

while case "$#" in 0) break ;; esac
case "$1" in
patch=-p ;;
+ -s)
+ sign=-s ;;
shift; break ;;
@@ -73,6 +76,12 @@ are available in the git repository at:' $baserev &&
echo " $url $branch" &&
echo &&

+if test -n "$sign"
+ printf "Commit $headrev\nfrom $url\n" | gpg --clearsign
+ echo
+fi &&
git shortlog ^$baserev $headrev &&
git diff -M --stat --summary $patch $merge_base..$headrev || exit
exit $status
 \ /
  Last update: 2011-10-31 16:57    [W:2.584 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site