<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/fast-export.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-03-26T19:42:57Z</updated>
<entry>
<title>fast-import: add 'abort-if-invalid' mode to '--signed-commits=&lt;mode&gt;'</title>
<updated>2026-03-26T19:42:57Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2026-03-26T19:14:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c36345e04cbef7edb94557119acba9f9a38c26f'/>
<id>urn:sha1:4c36345e04cbef7edb94557119acba9f9a38c26f</id>
<content type='text'>
The '--signed-commits=&lt;mode&gt;' option for git-fast-import(1) configures
how signed commits are handled when encountered. In cases where an
invalid commit signature is encountered, a user may wish to abort the
operation entirely. Introduce an 'abort-if-invalid' mode to do so.

Signed-off-by: Justin Tobler &lt;jltobler@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fast-export: check for unsupported signing modes earlier</title>
<updated>2026-03-26T19:42:57Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2026-03-26T19:14:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d35cc472e24394edb21a9b4d0abe25f5b2a91f2'/>
<id>urn:sha1:6d35cc472e24394edb21a9b4d0abe25f5b2a91f2</id>
<content type='text'>
The '--signed-{commits,tags}' options for git-fast-export(1) support
only a subset of the modes accepted by git-fast-import(1). Unsupported
modes such as 'strip-if-invalid' and 'sign-if-invalid' are accepted
during option parsing, but cause the command to die later when a signed
object is encountered.

Instead, reject unsupported signing modes immediately after parsing the
option. This treats them the same as other unknown modes and avoids
deferring the error until object processing. This also removes
duplicated checks in commit/tag handling code.

Signed-off-by: Justin Tobler &lt;jltobler@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fast-import: add mode to sign commits with invalid signatures</title>
<updated>2026-03-13T04:28:20Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2026-03-13T01:39:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee66c793f84ef1c84ec3fe732bb26394ebefd257'/>
<id>urn:sha1:ee66c793f84ef1c84ec3fe732bb26394ebefd257</id>
<content type='text'>
With git-fast-import(1), handling of signed commits is controlled via
the `--signed-commits=&lt;mode&gt;` option. When an invalid signature is
encountered, a user may want the option to sign the commit again as
opposed to just stripping the signature. To facilitate this, introduce a
"sign-if-invalid" mode for the `--signed-commits` option. Optionally, a
key ID may be explicitly provided in the form
`sign-if-invalid[=&lt;keyid&gt;]` to specify which signing key should be used
when signing invalid commit signatures.

Note that to properly support interoperability mode when signing commit
signatures, the commit buffer must be created in both the repository and
compatability object formats to generate the appropriate signatures
accordingly. As currently implemented, the commit buffer for the
compatability object format is not reconstructed and thus signing
commits in interoperability mode is not yet supported. Support may be
added in the future.

Signed-off-by: Justin Tobler &lt;jltobler@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list: add string_list_sort_u() that mimics "sort -u"</title>
<updated>2026-01-29T17:32:50Z</updated>
<author>
<name>Amisha Chhajed</name>
<email>amishhhaaaa@gmail.com</email>
</author>
<published>2026-01-29T12:12:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e711acfbdfc0fedf631688d78cde153ba835c93'/>
<id>urn:sha1:2e711acfbdfc0fedf631688d78cde153ba835c93</id>
<content type='text'>
Many callsites of string_list_remove_duplicates() call it
immdediately after calling string_list_sort(), understandably
as the former requires string-list to be sorted, it is clear
that these places are sorting only to remove duplicates and
for no other reason.

Introduce a helper function string_list_sort_u that combines
these two calls that often appear together, to simplify
these callsites. Replace the current calls of those methods with
string_list_sort_u().

Signed-off-by: Amisha Chhajed &lt;amishhhaaaa@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cc/fast-import-strip-if-invalid'</title>
<updated>2025-12-05T05:49:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-12-05T05:49:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1b40ddc1a5e2eecd54802c3c6c3c940b0306542a'/>
<id>urn:sha1:1b40ddc1a5e2eecd54802c3c6c3c940b0306542a</id>
<content type='text'>
"git fast-import" learns "--strip-if-invalid" option to drop
invalid cryptographic signature from objects.

* cc/fast-import-strip-if-invalid:
  fast-import: add 'strip-if-invalid' mode to --signed-commits=&lt;mode&gt;
  commit: refactor verify_commit_buffer()
  fast-import: refactor finalize_commit_buffer()
</content>
</entry>
<entry>
<title>fast-import: add 'strip-if-invalid' mode to --signed-commits=&lt;mode&gt;</title>
<updated>2025-11-26T16:43:44Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2025-11-17T04:34:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c20f112e5149d1bd0d4741c4b28a65f81318309a'/>
<id>urn:sha1:c20f112e5149d1bd0d4741c4b28a65f81318309a</id>
<content type='text'>
Tools like `git filter-repo`[1] use `git fast-export` and
`git fast-import` to rewrite repository history. When rewriting
history using one such tool though, commit signatures might become
invalid because the commits they sign changed due to the changes
in the repository history made by the tool between the fast-export
and the fast-import steps.

Note that as far as signature handling goes:

  * Since fast-export doesn't know what changes filter-repo may make
to the stream, it can't know whether the signatures will still be
valid.

  * Since filter-repo doesn't know what history canonicalizations
fast-export performed (and it performs a few), it can't know whether
the signatures will still be valid.

  * Therefore, fast-import is the only process in the pipeline that
can know whether a specified signature remains valid.

Having invalid signatures in a rewritten repository could be
confusing, so users rewritting history might prefer to simply
discard signatures that are invalid at the fast-import step.

For example a common use case is to rewrite only "recent" history.
While specifying commit ranges corresponding to "recent" commits
could work, users worry about getting it wrong and want to just
automatically rewrite everything, expecting older commit signatures
to be untouched.

To let them do that, let's add a new 'strip-if-invalid' mode to the
`--signed-commits=&lt;mode&gt;` option of `git fast-import`.

It would be interesting for the `--signed-tags=&lt;mode&gt;` option to
have this mode too, but we leave that for a future improvement.

It might also be possible for `git fast-export` to have such a mode
in its `--signed-commits=&lt;mode&gt;` and `--signed-tags=&lt;mode&gt;`
options, but the use cases for it are much less clear, so we also
leave that for possible future improvements.

For now let's just die() if 'strip-if-invalid' is passed to these
options where it hasn't been implemented yet.

[1]: https://github.com/newren/git-filter-repo

Helped-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cc/fast-import-export-i18n-cleanup'</title>
<updated>2025-11-06T23:17:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-11-06T23:17:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e569dced68a486b38b14cdd2e3e0b34d21752a18'/>
<id>urn:sha1:e569dced68a486b38b14cdd2e3e0b34d21752a18</id>
<content type='text'>
Messages from fast-import/export are now marked for i18n.

* cc/fast-import-export-i18n-cleanup:
  gpg-interface: mark a string for translation
  fast-import: mark strings for translation
  fast-export: mark strings for translation
  gpg-interface: use left shift to define GPG_VERIFY_*
  gpg-interface: simplify ssh fingerprint parsing
</content>
</entry>
<entry>
<title>fast-export: mark strings for translation</title>
<updated>2025-10-30T14:06:58Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2025-10-30T12:33:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d53287b734cd24d40b1509d77741a59eb5564764'/>
<id>urn:sha1:d53287b734cd24d40b1509d77741a59eb5564764</id>
<content type='text'>
Some error or warning messages in "builtin/fast-export.c" are marked
for translation, but many are not.

To be more consistent and provide a better experience to people using a
translated version, let's mark all the remaining error or warning
messages for translation.

While at it:

  - improve how some arguments to some error functions are indented,
  - remove "Error:" at the start of an error message,
  - downcase error and warning messages that start with an uppercase.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fast-export: handle all kinds of tag signatures</title>
<updated>2025-10-13T15:51:42Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2025-10-13T08:48:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=31f375c31c645f35b83427045cfef719f2e4301b'/>
<id>urn:sha1:31f375c31c645f35b83427045cfef719f2e4301b</id>
<content type='text'>
Currently the handle_tag() function in "builtin/fast-export.c" searches
only for "\n-----BEGIN PGP SIGNATURE-----\n" in the tag message to find
a tag signature.

This doesn't handle all kinds of OpenPGP signatures as some can start
with "-----BEGIN PGP MESSAGE-----" too, and this doesn't handle SSH and
X.509 signatures either as they use "-----BEGIN SSH SIGNATURE-----" and
"-----BEGIN SIGNED MESSAGE-----" respectively.

To handle all these kinds of tag signatures supported by Git, let's use
the parse_signed_buffer() function to properly find signatures in tag
messages.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: refactor 'enum sign_mode' parsing</title>
<updated>2025-09-17T18:18:28Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2025-09-17T18:14:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f8fd208c36bf2e88f949d0c4059214dfcb2a717'/>
<id>urn:sha1:2f8fd208c36bf2e88f949d0c4059214dfcb2a717</id>
<content type='text'>
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=&lt;mode&gt;' or '--signed-commits=&lt;mode&gt;'
options.

In a following commit, we are going to add a similar option to `git
fast-import`, which will be simpler, easier and cleaner if we can reuse
the 'enum sign_mode' defintion and parsing code.

So let's move that definition and parsing code from
"builtin/fast-export.c" to "gpg-interface.{c,h}".

While at it, let's fix a small indentation issue with the arguments of
parse_opt_sign_mode().

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
