filter-repo: don't crash on streams containing gpgsig blocks#741
Open
chriscool wants to merge 1 commit into
Open
filter-repo: don't crash on streams containing gpgsig blocks#741chriscool wants to merge 1 commit into
chriscool wants to merge 1 commit into
Conversation
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>
fdc03c0 to
2a118d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
gpgsigheader blocks followed by adatablock for the signature content. Git >= v2.50.0 can emit such blocks betweencommitterandencoding/data, using for example:git fast-export --signed-commits=verbatimUp to two
gpgsigblocks 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_dataif a stream containinggpgsigblocks is fed in (e.g. by hand or by a future version of filter-repo).