-
Notifications
You must be signed in to change notification settings - Fork 848
plumbing: support commits extra headers, support jujutsu signed commit [5.x] #1633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pjbgf
merged 1 commit into
go-git:releases/v5.x
from
baloo:baloo/release-5.x/jj-signed-commits
Sep 17, 2025
Merged
plumbing: support commits extra headers, support jujutsu signed commit [5.x] #1633
pjbgf
merged 1 commit into
go-git:releases/v5.x
from
baloo:baloo/release-5.x/jj-signed-commits
Sep 17, 2025
Conversation
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
8e9c1d5 to
df9f1d1
Compare
45a4957 to
9786f5e
Compare
This adds support for extra headers. While git has a set of ["standard headers"] (`tree`, `parent`, `author`, `committer`, and `encoding`), 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 go-git#1626 ["standard headers"]: https://github.com/git/git/blob/724518f3884d8707c5f51428ba98c115818229b8/commit.c#L1450 [extra headers]: https://github.com/git/git/blob/724518f3884d8707c5f51428ba98c115818229b8/commit.c#L1690 [Jujutsu]: https://github.com/jj-vcs/jj
9786f5e to
f2c3467
Compare
Contributor
Author
|
rebased on #1646 to fix CI |
pjbgf
approved these changes
Sep 17, 2025
Member
pjbgf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@baloo thanks for backporting this. 🙇
project-mirrors-bot-tu bot
pushed a commit
to project-mirrors/forgejo-runner
that referenced
this pull request
Oct 11, 2025
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) | `v5.16.2` -> `v5.16.3` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>go-git/go-git (github.com/go-git/go-git/v5)</summary> ### [`v5.16.3`](https://github.com/go-git/go-git/releases/tag/v5.16.3) [Compare Source](go-git/go-git@v5.16.2...v5.16.3) #### What's Changed - internal: Expand regex to fix build \[5.x] by [@​baloo](https://github.com/baloo) in [#​1644](go-git/go-git#1644) - build: raise timeouts for windows CI tests and disable CIFuzz \[5.x] by [@​baloo](https://github.com/baloo) in [#​1646](go-git/go-git#1646) - plumbing: support commits extra headers, support jujutsu signed commit \[5.x] by [@​baloo](https://github.com/baloo) in [#​1633](go-git/go-git#1633) **Full Changelog**: <go-git/go-git@v5.16.2...v5.16.3> </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzEuOSIsInVwZGF0ZWRJblZlciI6IjQxLjEzMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY3lVcGRhdGUiLCJydW4tZW5kLXRvLWVuZC10ZXN0cyJdfQ==--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1062 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org> Co-authored-by: Renovate Bot <bot@kriese.eu> Co-committed-by: Renovate Bot <bot@kriese.eu>
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 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
EncodeWithoutSignatureto 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