| 1 |
From: Eric Dorland <[email protected]> |
| 2 |
Date: Sun, 6 Sep 2026 00:59:14 -0400 |
| 3 |
Subject: Revert 5cdf34d to allow building against gix 0.86 |
| 4 |
|
| 5 |
--- |
| 6 |
CHANGELOG.md | 4 ---- |
| 7 |
lib/src/git_backend.rs | 15 ++++++++------- |
| 8 |
2 files changed, 8 insertions(+), 11 deletions(-) |
| 9 |
|
| 10 |
diff --git a/CHANGELOG.md b/CHANGELOG.md |
| 11 |
index 19ffa10..5682b58 100644 |
| 12 |
--- a/CHANGELOG.md |
| 13 |
+++ b/CHANGELOG.md |
| 14 |
@@ -29,10 +29,6 @@ published. |
| 15 |
after all versions of the `bisync` crate, a transitive dependency of gix, |
| 16 |
were yanked. |
| 17 |
|
| 18 |
-* Signatures on commits in SHA-256 Git repositories are now stored under the |
| 19 |
- `gpgsig-sha256` header, as Git does, so Git recognizes them as signed and |
| 20 |
- jj can read them back. |
| 21 |
- |
| 22 |
## [0.45.0] - 2026-09-02 |
| 23 |
|
| 24 |
### Release highlights |
| 25 |
diff --git a/lib/src/git_backend.rs b/lib/src/git_backend.rs |
| 26 |
index 9db4c5c..edf870b 100644 |
| 27 |
--- a/lib/src/git_backend.rs |
| 28 |
+++ b/lib/src/git_backend.rs |
| 29 |
@@ -43,7 +43,6 @@ use gix::objs::CommitRefIter; |
| 30 |
use gix::objs::Exists as _; |
| 31 |
use gix::objs::Write as _; |
| 32 |
use gix::objs::WriteTo as _; |
| 33 |
-use gix::objs::commit::signature_field_name; |
| 34 |
use itertools::Itertools as _; |
| 35 |
use once_cell::sync::OnceCell as OnceLock; |
| 36 |
use pollster::FutureExt as _; |
| 37 |
@@ -729,7 +728,8 @@ fn commit_from_git_without_root_parent( |
| 38 |
let secure_sig = commit |
| 39 |
.extra_headers |
| 40 |
.iter() |
| 41 |
- .any(|(k, _)| *k == signature_field_name(git_object.id.kind())) |
| 42 |
+ // gix does not recognize gpgsig-sha256, but prevent future footguns by checking for it too |
| 43 |
+ .any(|(k, _)| *k == "gpgsig" || *k == "gpgsig-sha256") |
| 44 |
.then(|| CommitRefIter::signature(&git_object.data, git_object.id.kind())) |
| 45 |
.transpose() |
| 46 |
.map_err(decode_err)? |
| 47 |
@@ -1424,10 +1424,9 @@ impl Backend for GitBackend { |
| 48 |
object_type: "commit", |
| 49 |
source: Box::new(err), |
| 50 |
})?; |
| 51 |
- let field = signature_field_name(git_tree_id.kind()); |
| 52 |
commit |
| 53 |
.extra_headers |
| 54 |
- .push((field.into(), sig.clone().into())); |
| 55 |
+ .push(("gpgsig".into(), sig.clone().into())); |
| 56 |
contents.secure_sig = Some(SecureSig { data, sig }); |
| 57 |
} |
| 58 |
|
| 59 |
@@ -1987,8 +1986,10 @@ mod tests { |
| 60 |
commit.write_to(&mut commit_buf)?; |
| 61 |
let commit_str = str::from_utf8(&commit_buf)?; |
| 62 |
|
| 63 |
- let field = signature_field_name(object_hash); |
| 64 |
- commit.extra_headers.push((field.into(), secure_sig.into())); |
| 65 |
+ commit |
| 66 |
+ .extra_headers |
| 67 |
+ // TODO: should this conditionally become gpgsig-sha256 once gix supports it? |
| 68 |
+ .push(("gpgsig".into(), secure_sig.into())); |
| 69 |
|
| 70 |
let git_commit_id = git_repo.write_object(&commit)?; |
| 71 |
|
| 72 |
@@ -2528,7 +2529,7 @@ mod tests { |
| 73 |
author Someone <[email protected]> 0 +0000 |
| 74 |
committer Someone <[email protected]> 0 +0000 |
| 75 |
change-id xpxpxpxpxpxpxpxpxpxpxpxpxpxpxpxp |
| 76 |
- gpgsig-sha256 test sig |
| 77 |
+ gpgsig test sig |
| 78 |
hash=d6219e8e5169d409d115848dea4556b3accc76f3cd8dc9b128cc3fe9f71adae275f0e6ce9f98c581a89b960863b61c61b6479cdc20806009d63aecaaa82f4590 |
| 79 |
|
| 80 |
initial |