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

Re: [PATCH 2/2] fast-import: add '--signed-commits=<mode>' option

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 10, 2025, 18:21 UTC
Message-ID
<xmqqms72rwx4.fsf@gitster.g>
In-Reply-To
<20250910080839.2142651-3-christian.couder@gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 32 quoted lines
> A '--signed-commits=<mode>' option is already available when using
> `git fast-export` to decide what should be done at export time about
> commit signatures. At import time though, there is no option, or
> other way, in `git fast-import` to decide about commit signatures.
>
> To remediate that, let's add a '--signed-commits=<mode>' option to
> `git fast-import` too.
>
> For now the supported <mode>s are the same as those supported by
> `git fast-export`.
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
>  Documentation/git-fast-import.adoc |   5 ++
>  builtin/fast-import.c              |  55 +++++++++++----
>  t/meson.build                      |   1 +
>  t/t9305-fast-import-signatures.sh  | 108 +++++++++++++++++++++++++++++
>  4 files changed, 157 insertions(+), 12 deletions(-)
>  create mode 100755 t/t9305-fast-import-signatures.sh
>
> diff --git a/Documentation/git-fast-import.adoc b/Documentation/git-fast-import.adoc
> index 3144ffcdb6..90f242d058 100644
> --- a/Documentation/git-fast-import.adoc
> +++ b/Documentation/git-fast-import.adoc
> @@ -66,6 +66,11 @@ OPTIONS
>  	remote-helpers that use the `import` capability, as they are
>  	already trusted to run their own code.
>  
> +--signed-commits=(verbatim|warn-verbatim|warn-strip|strip|abort)::
> +	Specify how to handle signed commits.  Behaves in the same way
> +	as the same option in linkgit:git-fast-export[1], except that
> +	default is 'verbatim' (instead of 'abort').
I forgot one thing.  Earlier in 1/2 we saw
    The definition of 'enum sign_mode' as well as its parsing code are in
    "builtin/fast-export.c". This was fine because `git fast-export` was the
    only command with '--signed-tags=<mode>' or '--signed-commits=<mode>'
    options.
    In a following commit, we are going to add such options to `git
    fast-import`, which will be simpler, easier and cleaner if we can reuse
    the 'enum sign_mode' defintion and parsing code.

and I was implicitly expecting that both commits and tags would be supported on the import side, but this only deals with the commits?

Is patch [3/2] missing from the archive?
Thanks.
Previous: Christian CouderNext: Christian Couder
Message 15 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.