git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Matt Hunter" <m@lfurio.us>
Cc: <git@vger.kernel.org>
Subject: Re: How to gpg signed email patches?
Date: Mon, 14 Apr 2025 09:34:11 -0700	[thread overview]
Message-ID: <xmqqfriar9bw.fsf@gitster.g> (raw)
In-Reply-To: <D95V0Z9YMEX2.3J99CE4F6ZP8S@lfurio.us> (Matt Hunter's message of "Sun, 13 Apr 2025 18:21:46 -0400")

"Matt Hunter" <m@lfurio.us> writes:

> Hi
>
> On Sun Apr 13, 2025 at 3:17 PM EDT, Klaus Frank wrote:
>> how do I get "git send-email" to send the patches gpg signed? I tried
>> first signing the commit but after spending time looking into the
>> documentation I couldn't work out how to do it. All I discovered so far
>> is that the "git send-email" appears to be using "git format-patch"
>> internally and that's where it currently gets lost.
>
> There's a conceptual issue with mailing patches from signed commits.
> Once your patch recipient goes to apply it to their branch, they are
> recorded as the "committer" identity of the new commit object.  This
> would break the validity of any existing signature.
>
> This is likely the reason by the related git tools (format-patch, am)
> ignore this information.
>
> You may have also noticed that commands like git-rebase and
> git-cherry-pick will drop signatures from commits as well, since they
> are being replayed onto a different history, changing the commit data.

Very well said.  Protecting the e-mail with GPG is a job for
MUA/MSA, that is independent from signature used to sign objects
like commits and tags, so the signature over objects cannot be
reused by programs like send-email.

But send-email may not have an option to wrap its payload in s-mime
or pgp, which can be a separate project worth looking into.

Thanks.



  parent reply	other threads:[~2025-04-14 16:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-13 19:17 How to gpg signed email patches? Klaus Frank
2025-04-13 22:21 ` Matt Hunter
2025-04-13 23:12   ` Klaus Frank
2025-04-14 16:34   ` Junio C Hamano [this message]
2025-04-13 22:52 ` brian m. carlson
2025-04-14  0:23   ` Klaus Frank
2025-04-14  0:48     ` brian m. carlson
2025-04-14 19:12   ` Junio C Hamano
2025-04-14  1:34 ` Konstantin Ryabitsev
2025-04-14 15:14   ` Junio C Hamano

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=xmqqfriar9bw.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=m@lfurio.us \
    /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).