git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] fast-import: start controlling how commit signatures are handled
@ 2025-09-10  8:08 Christian Couder
  2025-09-10  8:08 ` [PATCH 1/2] gpg-interface: refactor 'enum sign_mode' parsing Christian Couder
  2025-09-10  8:08 ` [PATCH 2/2] fast-import: add '--signed-commits=<mode>' option Christian Couder
  0 siblings, 2 replies; 21+ messages in thread
From: Christian Couder @ 2025-09-10  8:08 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Patrick Steinhardt, Elijah Newren, Jeff King,
	brian m . carlson, Johannes Schindelin, Christian Couder

Tools like `git-filter-repo` should be able to control how commit
signatures are handled when regenerating repository content after it
has been filtered (see
https://github.com/newren/git-filter-repo/issues/139). For this
purpose, they need a way for `git fast-import` to control how commit
signatures are handled.

This small patch series starts to implement such a way by adding a new
`--signed-commits=<mode>` option to `git fast-import`.

For now this new option behaves in a very similar way as the option
with the same name that already exists in `git fast-export`.
Especially it supports exactly the same <mode>s and the same aliases
for these modes. For example "ignore" is a synonym for "verbatim".

In the future I want to implement new <mode>s like "strip-if-invalid",
"re-sign", "re-sign-if-invalid" that might be a bit more complex for
this option. But for now I prefer to start with the simple modes to
validate the general design of the new option.

In particular, I am interested in feedback about the following:

  - Should we keep "ignore" as a synonym for "verbatim" and "warn" as
    a synonym for "warn-verbatim"? My opinion is that they might be
    confusing, so we might want to remove them for `git fast-import`
    even if we keep them for `git fast-export`. The parsing code might
    be a bit more complex if we do that though, so for now I have kept
    the synonyms.

  - Are we still fine with most <mode>s having a "warn-*" variant
    (like the "warn-strip" variant of "strip" for example)? Or should
    we have a separate `--verbose` or maybe `--signed-commits-verbose`
    option dedicated to switching warnings on/off? I think it's good
    to decide about this before the number of <mode>s increases a lot
    with new <mode>s like "strip-if-invalid", "re-sign",
    "re-sign-if-invalid" and possibly others.

CI tests:

They have all passed. See:

https://github.com/chriscool/git/actions/runs/17606244845/job/50017575843


Christian Couder (2):
  gpg-interface: refactor 'enum sign_mode' parsing
  fast-import: add '--signed-commits=<mode>' option

 Documentation/git-fast-import.adoc |   5 ++
 builtin/fast-export.c              |  23 ++----
 builtin/fast-import.c              |  55 +++++++++++----
 gpg-interface.c                    |  17 +++++
 gpg-interface.h                    |  15 ++++
 t/meson.build                      |   1 +
 t/t9305-fast-import-signatures.sh  | 108 +++++++++++++++++++++++++++++
 7 files changed, 196 insertions(+), 28 deletions(-)
 create mode 100755 t/t9305-fast-import-signatures.sh

-- 
2.51.0.195.g61112aeac3


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2025-09-17 18:28 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10  8:08 [PATCH 0/2] fast-import: start controlling how commit signatures are handled Christian Couder
2025-09-10  8:08 ` [PATCH 1/2] gpg-interface: refactor 'enum sign_mode' parsing Christian Couder
2025-09-10 16:50   ` Junio C Hamano
2025-09-11  6:06   ` Patrick Steinhardt
2025-09-11 16:29     ` Junio C Hamano
2025-09-12 12:40       ` Christian Couder
2025-09-12 12:40     ` Christian Couder
2025-09-10  8:08 ` [PATCH 2/2] fast-import: add '--signed-commits=<mode>' option Christian Couder
2025-09-10 17:09   ` Junio C Hamano
2025-09-12 13:35     ` Christian Couder
2025-09-12 14:14       ` Junio C Hamano
2025-09-15 10:29         ` Christian Couder
2025-09-15 16:02           ` Junio C Hamano
2025-09-17 18:27             ` Christian Couder
2025-09-10 18:21   ` Junio C Hamano
2025-09-12 13:41     ` Christian Couder
2025-09-12 14:09       ` Junio C Hamano
2025-09-11  6:06   ` Patrick Steinhardt
2025-09-11 16:55     ` Junio C Hamano
2025-09-12 13:47       ` Christian Couder
2025-09-12 13:25     ` Christian Couder

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).