Subject: Re: [PATCH 0/3] fast-import: add 'strip-if-invalid' mode to --signed-commits=<mode>

From: Junio C Hamano <[email-masked]>
Date: Wed, 12 Nov 2025 08:51:15 -0800

Christian Couder <[email-masked]> writes:

>> Even if you are not changing a single bit in the import,
>> some of your early commits' signatures do not "validate" and may
>> need to be stripped, and after that happens, wouldn't signatures of
>> all later commits become unusable (i.e, you may be able to verify
>> that the signature on the original commit object may still be valid,
>> but because the commit has to become a child of a rewritten commit,
>> in the resulting history the signature would no longer match)?
>
> Yes, I agree it could be an optimization to consider all the
> subsequent signatures invalid after one of them is invalid, but it
> would require making sure that the commit history that `git
> fast-import` receives is completely linear or that we properly track
> commit history when it's not not linear. I think it's better to start
> with a relatively simpler implementation like this one though.

Note that I wasn't suggesting any optimization.

I was saying that the cascading effect would mean strip-if-invalid
may have to strip all the later commits of their signatures anyway,
which makes us question the usefulness of the feature.

The other message from Elijah made it clear what the piece this
series implements fits in a bigger picture, so I actually am OK as
long as the overall use case fits what he described in that message.

Thanks.