git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/2] fast-import: start controlling how commit signatures are handled

From
Christian Couder <christian.couder@gmail.com>
Date
Sep 10, 2025, 08:08 UTC
Message-ID
<20250910080839.2142651-1-christian.couder@gmail.com>

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
Next: Christian Couder
Message 1 of 21 in “fast-import: start controlling how commit signatures are handled”
  1. 0/2 fast-import: start controlling how commit signatures are handledChristian Couder, Sep 10, 2025
  2. 1/2 gpg-interface: refactor 'enum sign_mode' parsingChristian Couder, Sep 10, 2025
  3. Junio C HamanoSep 10, 2025
  4. Patrick SteinhardtSep 11, 2025
  5. Junio C HamanoSep 11, 2025
  6. Christian CouderSep 12, 2025
  7. Christian CouderSep 12, 2025
  8. 2/2 fast-import: add '--signed-commits=<mode>' optionChristian Couder, Sep 10, 2025
  9. Junio C HamanoSep 10, 2025
  10. Christian CouderSep 12, 2025
  11. Junio C HamanoSep 12, 2025
  12. Christian CouderSep 15, 2025
  13. Junio C HamanoSep 15, 2025
  14. Christian CouderSep 17, 2025
  15. Junio C HamanoSep 10, 2025
  16. Christian CouderSep 12, 2025
  17. Junio C HamanoSep 12, 2025
  18. Patrick SteinhardtSep 11, 2025
  19. Junio C HamanoSep 11, 2025
  20. Christian CouderSep 12, 2025
  21. Christian CouderSep 12, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.