]> git.ipfire.org Git - thirdparty/git.git/commit
fast-export, fast-import: add support for signed-commits
authorLuke Shumaker <lukeshu@datawire.io>
Mon, 10 Mar 2025 15:57:46 +0000 (16:57 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Mar 2025 20:24:56 +0000 (13:24 -0700)
commitd9cb0e6ff8b369b0410ac8fb11657f5096d74b8e
treed0c4ce0803739466a1fc9c3e3808592ccbb498b9
parentdda9bff3c55e45ee8dbfb49fd972c4b35fd4ba7e
fast-export, fast-import: add support for signed-commits

fast-export has a --signed-tags= option that controls how to handle tag
signatures.  However, there is no equivalent for commit signatures; it
just silently strips the signature out of the commit (analogously to
--signed-tags=strip).

While signatures are generally problematic for fast-export/fast-import
(because hashes are likely to change), if they're going to support tag
signatures, there's no reason to not also support commit signatures.

So, implement a --signed-commits= option that mirrors the --signed-tags=
option.

On the fast-export side, try to be as much like signed-tags as possible,
in both implementation and in user-interface.  This will change the
default behavior to '--signed-commits=abort' from what is now
'--signed-commits=strip'.  In order to provide an escape hatch for users
of third-party tools that call fast-export and do not yet know of the
--signed-commits= option, add an environment variable
'FAST_EXPORT_SIGNED_COMMITS_NOABORT=1' that changes the default to
'--signed-commits=warn-strip'.

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-export.adoc
Documentation/git-fast-import.adoc
builtin/fast-export.c
builtin/fast-import.c
t/t9350-fast-export.sh