Skip to content

filter-repo: don't crash on streams containing gpgsig blocks#741

Open
chriscool wants to merge 1 commit into
newren:mainfrom
chriscool:cc-ignore-gpgsig-blocks
Open

filter-repo: don't crash on streams containing gpgsig blocks#741
chriscool wants to merge 1 commit into
newren:mainfrom
chriscool:cc-ignore-gpgsig-blocks

Conversation

@chriscool
Copy link
Copy Markdown

@chriscool chriscool commented Apr 29, 2026

This is to address #139. It's the first PR of the 3-PR plan described in:

#139 (comment)

Let me know if you prefer me to send this as a patch series (or maybe a single patch) to the Git mailing list.

In the future we want to preserve commit signatures.

To prepare for that, let's teach the fast-export stream parser to recognize and skip gpgsig header blocks followed by a data block for the signature content. Git >= v2.50.0 can emit such blocks between committer and encoding/data, using for example:

git fast-export --signed-commits=verbatim

Up to two gpgsig blocks may appear (one per hash algorithm).

Note that no new flags are passed to git fast-export, so signatures are still stripped in practice. We only prevent an assertion failure in _parse_data if a stream containing gpgsig blocks is fed in (e.g. by hand or by a future version of filter-repo).

In the future we want to preserve commit signatures (see issue newren#139).

To prepare for that, let's teach the fast-export stream parser to
recognize and skip `gpgsig` header blocks followed by a `data` block
for the signature content. Git >= v2.50.0 can emit such blocks
between `committer` and `encoding`/`data`, using for example:

  `git fast-export --signed-commits=verbatim`

Up to two `gpgsig` blocks may appear (one per hash algorithm).

Note that no new flags are passed to `git fast-export`, so signatures
are still stripped in practice. We only prevent an assertion failure in
`_parse_data` if a stream containing `gpgsig` blocks is fed in (e.g. by
hand or by a future version of filter-repo).

Signed-off-by: Christian Couder <christian.couder@gmail.com>
@chriscool chriscool force-pushed the cc-ignore-gpgsig-blocks branch from fdc03c0 to 2a118d2 Compare April 29, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant