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

From: Christian Couder <[email-masked]>
Date: Wed, 5 Nov 2025 07:19:15 +0100

The `--signed-commits=<mode>` option in `git fast-import` allows users
to decide what should be done when commits with signatures are
imported.

For tools like `git filter-repo`, it would be useful to be able to
strip signatures when they are invalid, so let's add a new
'strip-if-invalid' mode for that purpose.

Maybe this new mode should become the default mode, but this would be
breaking backward compatibility, and perhaps this could be decided
after other new modes that might be even better default modes have
been added. So we leave that for future work.

This 'strip-if-invalid' mode should also be added to
`--signed-tags=<mode>`, but we leave that for future work too.

CI tests
========

They have all passed, see:

https://github.com/chriscool/git/actions/runs/19091593841/job/54543228129

Christian Couder (3):
  fast-import: refactor finalize_commit_buffer()
  commit: refactor verify_commit_buffer()
  fast-import: add 'strip-if-invalid' mode to --signed-commits=<mode>

 Documentation/git-fast-import.adoc |  28 ++++---
 builtin/fast-export.c              |  46 ++++++++---
 builtin/fast-import.c              |  74 +++++++++++++++---
 commit.c                           |  17 ++++-
 commit.h                           |   7 ++
 gpg-interface.c                    |   2 +
 gpg-interface.h                    |   1 +
 t/t9305-fast-import-signatures.sh  | 118 ++++++++++++++++++++++++++++-
 8 files changed, 260 insertions(+), 33 deletions(-)

-- 
2.52.0.rc0.3.gf264cd25e5