Re: [BUG] v2.45+: git commit -S invalidates signature for non-UTF-8 messages
- From
- Kushal Das <kushal@sunet.se>
- Date
- Apr 21, 2026, 07:39 UTC
- Message-ID
- <c0df6dbd-47f9-4a2d-b68d-cb0c1e19ca5a@sunet.se>
- In-Reply-To
- <aeakf0xcjSteTMZp@fruit.crustytoothpaste.net>
Hi,
On 4/21/26 12:11 AM, brian m. carlson wrote:
Show 14 quoted lines
> 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