From: Eric Dorland Date: Sun, 6 Sep 2026 00:59:14 -0400 Subject: Revert 5cdf34d to allow building against gix 0.86 --- CHANGELOG.md | 4 ---- lib/src/git_backend.rs | 15 ++++++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19ffa10..5682b58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,10 +29,6 @@ published. after all versions of the `bisync` crate, a transitive dependency of gix, were yanked. -* Signatures on commits in SHA-256 Git repositories are now stored under the - `gpgsig-sha256` header, as Git does, so Git recognizes them as signed and - jj can read them back. - ## [0.45.0] - 2026-09-02 ### Release highlights diff --git a/lib/src/git_backend.rs b/lib/src/git_backend.rs index 9db4c5c..edf870b 100644 --- a/lib/src/git_backend.rs +++ b/lib/src/git_backend.rs @@ -43,7 +43,6 @@ use gix::objs::CommitRefIter; use gix::objs::Exists as _; use gix::objs::Write as _; use gix::objs::WriteTo as _; -use gix::objs::commit::signature_field_name; use itertools::Itertools as _; use once_cell::sync::OnceCell as OnceLock; use pollster::FutureExt as _; @@ -729,7 +728,8 @@ fn commit_from_git_without_root_parent( let secure_sig = commit .extra_headers .iter() - .any(|(k, _)| *k == signature_field_name(git_object.id.kind())) + // gix does not recognize gpgsig-sha256, but prevent future footguns by checking for it too + .any(|(k, _)| *k == "gpgsig" || *k == "gpgsig-sha256") .then(|| CommitRefIter::signature(&git_object.data, git_object.id.kind())) .transpose() .map_err(decode_err)? @@ -1424,10 +1424,9 @@ impl Backend for GitBackend { object_type: "commit", source: Box::new(err), })?; - let field = signature_field_name(git_tree_id.kind()); commit .extra_headers - .push((field.into(), sig.clone().into())); + .push(("gpgsig".into(), sig.clone().into())); contents.secure_sig = Some(SecureSig { data, sig }); } @@ -1987,8 +1986,10 @@ mod tests { commit.write_to(&mut commit_buf)?; let commit_str = str::from_utf8(&commit_buf)?; - let field = signature_field_name(object_hash); - commit.extra_headers.push((field.into(), secure_sig.into())); + commit + .extra_headers + // TODO: should this conditionally become gpgsig-sha256 once gix supports it? + .push(("gpgsig".into(), secure_sig.into())); let git_commit_id = git_repo.write_object(&commit)?; @@ -2528,7 +2529,7 @@ mod tests { author Someone 0 +0000 committer Someone 0 +0000 change-id xpxpxpxpxpxpxpxpxpxpxpxpxpxpxpxp - gpgsig-sha256 test sig + gpgsig test sig hash=d6219e8e5169d409d115848dea4556b3accc76f3cd8dc9b128cc3fe9f71adae275f0e6ce9f98c581a89b960863b61c61b6479cdc20806009d63aecaaa82f4590 initial