fast-import: start controlling how tag signatures are handled
Introduction
Tools like git-filter-repo
should be able to control how tag
signatures are handled when regenerating repository content after it
has been filtered. For this purpose, they need a way for git fast-import
to control how tag signatures are handled.
A previous series [1] added a '--signed-commits=' option to git fast-import
to control how commit signatures are handled, so this is
adding a similar '--signed-tags=' for tag signatures.
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 s and the same aliases
for these modes. For example "ignore" is a synonym for "verbatim".
This way, both git fast-export
and git fast-import
have both a
'--signed-tags=' and a '--signed-commits=' supporting the
same s.
In the future I want to implement new s like "strip-if-invalid",
"re-sign", "re-sign-if-invalid" in git fast-import
for both tag and
commit signatures. These might be a bit more complex, so for now I
prefer to start with the simple modes.
[1] https://lore.kernel.org/git/20250917181427.3193500-1-christian.couder@gmail.com/
Note about the different patches
Patch 1/5 (doc: git-tag: stop focussing on GPG signed tags) is a
documentation update for git tag
. It could go in a separate series
or be dropped altogether, but while working on this I thought that it
would be a good thing to do, as the doc is quite outdated.
Patches 2/5, 3/5 and 4/5 are preparatory patches for the main one which is patch 5/5 (fast-import: add '--signed-tags=' option).
I wanted '--signed-tags=' to work for all kinds of signature in
tags (OpenPGP, X.509 and SSH) but soon realized that the
'--signed-tags=' option of git fast-export
worked only for
OpenPGP signatures, so I fixed that issue in patch 4/5 (fast-export:
handle all kinds of tag signatures).
While working on the tests in patch 4/5, I found a few things to improve that could belong to other patches so that's how I came up with patches 2/5 and 3/5.
This is related to #519