Git development
 help / color / mirror / Atom feed
From: Kushal Das <kushal@sunet.se>
To: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Subject: Re: [BUG] v2.45+: git commit -S invalidates signature for non-UTF-8 messages
Date: Tue, 21 Apr 2026 09:39:11 +0200	[thread overview]
Message-ID: <c0df6dbd-47f9-4a2d-b68d-cb0c1e19ca5a@sunet.se> (raw)
In-Reply-To: <aeakf0xcjSteTMZp@fruit.crustytoothpaste.net>

Hi,

On 4/21/26 12:11 AM, brian m. carlson wrote:
> On 2026-04-20 at 08:59:05, Kushal Das wrote:
>> Hi all,
>>
>> Every `git commit -S` since v2.45.0 produces a permanently-BAD
>> signature when the commit message contains bytes that are not valid
>> UTF-8 AND `i18n.commitEncoding` is unset (i.e. the default case).
>> Verification fails under both `gpg --verify` and any non-GnuPG signer.
>> The failure is deterministic: it happens every time, on every
>> non-UTF-8 commit, no card or external tooling needed.
> 
> I'm not sure that's a valid configuration.  The commit message either
> needs to be UTF-8 or you need to declare the encoding so Git can convert
> it.
> 

It is not a valid configuration, but I am guessing there are more people 
like me who never knew this configuration and just freaked out by seeing 
bad signatures over own commits :)

Thank you for quick fix.

I am also wondering in the test harness for git signing, if you want to 
include other tools than gnupg for testing.

Kushal


  parent reply	other threads:[~2026-04-21  7:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20  8:59 [BUG] v2.45+: git commit -S invalidates signature for non-UTF-8 messages Kushal Das
2026-04-20 22:11 ` brian m. carlson
2026-04-20 22:14   ` [PATCH 1/2] commit: name UTF-8 function appropriately brian m. carlson
2026-04-20 22:14     ` [PATCH 2/2] commit: sign commit after mutating buffer brian m. carlson
2026-04-22 15:10       ` Elijah Newren
2026-04-24 20:17         ` brian m. carlson
2026-04-22 15:10     ` [PATCH 1/2] commit: name UTF-8 function appropriately Elijah Newren
2026-04-21  7:39   ` Kushal Das [this message]
2026-04-21 22:13     ` [BUG] v2.45+: git commit -S invalidates signature for non-UTF-8 messages brian m. carlson
2026-04-22 18:13   ` D. Ben Knoble
2026-04-27 22:18   ` [PATCH v2 1/2] commit: name UTF-8 function appropriately brian m. carlson
2026-04-27 22:18     ` [PATCH v2 2/2] commit: sign commit after mutating buffer brian m. carlson
2026-05-12  5:54       ` 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=c0df6dbd-47f9-4a2d-b68d-cb0c1e19ca5a@sunet.se \
    --to=kushal@sunet.se \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.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