plumbing: support commits extra headers, support jujutsu signed commit [5.x] #1633
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 adds support for extra headers. While git has a set of "standard headers" (
tree
,parent
,author
,committer
, andencoding
), it will also support extra headers when serializing.The extra headers must come after the standard ones, but they are otherwise freetyped.
Jujutsu takes advantage of that to store its own identifier (
change-id
) as an extra header.Because signatures will cover the hash of the whole commit (standard headers, extra headers and the message. Everything but the signature itself), if we deserialize a commit and then
EncodeWithoutSignature
to get back the "canonical" representation of a commit, if we don't serialize back the extra headers, the hash will no longer match and the signature will fail to verify.This adds support for parsing and reencoding the extra headers from the original commit and it's expected to fix support for Jujutsu signed commits.
Fixes #1626
This is a backport of #1627 targeting
release-5.x