Source: stgit
Version: 2.6.1-1.2
Severity: important
Tags: patch
User: [email protected]
Usertags: gix-0.89
X-Debbugs-Cc: [email protected]

Dear maintainer,

I am preparing a gix transition to 0.89, which will likely be uploaded soon.

stgit build-depends on librust-gix-dev (>= 0.87) with no upper bound. The 
package does not build against gix 0.89.

I have attached a debdiff fixing this, which is simply a cherry pick of an 
upstream commit.

Best regards,
Simon Quigley
[email protected]
diff -Nru stgit-2.6.1/debian/changelog stgit-2.6.1/debian/changelog
--- stgit-2.6.1/debian/changelog        2026-09-18 14:52:28.000000000 -0500
+++ stgit-2.6.1/debian/changelog        2026-10-11 15:44:35.000000000 -0500
@@ -1,3 +1,10 @@
+stgit (2.6.1-1.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Cherry-pick upstream gix 0.89 update (2833a46f).
+
+ -- Simon Quigley <[email protected]>  Sun, 11 Oct 2026 15:44:35 -0500
+
 stgit (2.6.1-1.2) unstable; urgency=medium
 
   * Non-maintainer upload (Closes: #1148264).
diff -Nru stgit-2.6.1/debian/control stgit-2.6.1/debian/control
--- stgit-2.6.1/debian/control  2026-09-18 14:52:05.000000000 -0500
+++ stgit-2.6.1/debian/control  2026-10-09 22:04:51.000000000 -0500
@@ -24,7 +24,8 @@
  librust-curl-dev,
  librust-encoding-rs-dev,
  librust-flate2-dev,
- librust-gix-dev (>= 0.87),
+ librust-gix-dev (>= 0.89),
+ librust-gix-dev (<< 0.90),
  librust-indexmap-dev,
  librust-is-terminal-dev,
  librust-jiff-dev (>= 0.2.1),
diff -Nru stgit-2.6.1/debian/patches/gix-0.89.patch 
stgit-2.6.1/debian/patches/gix-0.89.patch
--- stgit-2.6.1/debian/patches/gix-0.89.patch   1969-12-31 18:00:00.000000000 
-0600
+++ stgit-2.6.1/debian/patches/gix-0.89.patch   2026-10-11 15:10:50.000000000 
-0500
@@ -0,0 +1,149 @@
+Description: chore: update gix to 0.89
+ gix-date now requires at least nine digits before reading a bare number
+ as seconds since the epoch, matching git. So `--authdate 123456` is now
+ rejected, just as git rejects GIT_AUTHOR_DATE=123456; `@123456` still
+ works.
+ .
+ gix's per-module error types are consolidated under gix::Error, so
+ not-found is detected with is_not_found() rather than by matching
+ specific error variants. That classification also catches unresolvable
+ refs, so `stg id refs/heads/nosuch` now reports "revision not found"
+ instead of "couldn't parse revision".
+ .
+ SHA-1 hashing moves from sha1-checked to sha1dc, which keeps collision
+ detection. The remaining changes are mechanical responses to gix
+ interface changes.
+Author: Peter Grayson <[email protected]>
+Origin: upstream
+Applied-Upstream: 2833a46fb266d024943586e4b171a23093e9be41
+Last-Update: 2026-10-11
+---
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -43,7 +43,7 @@ clap = { version = "~4.6", default-featu
+ ctrlc = "3.4"
+ encoding_rs = "0.8"
+ flate2 = "1"
+-gix = { version = "0.87", default-features = false, features = [
++gix = { version = "0.89", default-features = false, features = [
+   "command",
+   "revision",
+   "sha1",
+--- a/src/ext/repository.rs
++++ b/src/ext/repository.rs
+@@ -132,12 +132,11 @@ impl RepositoryExtended for gix::Reposit
+         use gix::refs::Category;
+ 
+         let gix_name: gix::refs::PartialName = branch_name.into();
+-        let reference = self.find_reference(&gix_name).map_err(|e| match e {
+-            gix::reference::find::existing::Error::Find(inner) => {
+-                anyhow!("invalid branch name `{branch_name}`: {inner}")
+-            }
+-            gix::reference::find::existing::Error::NotFound { name } => {
+-                anyhow!("branch `{}` not found", name.as_ref().as_bstr())
++        let reference = self.find_reference(&gix_name).map_err(|e| {
++            if e.is_not_found() {
++                anyhow!("branch `{branch_name}` not found")
++            } else {
++                anyhow!("invalid branch name `{branch_name}`: {e}")
+             }
+         })?;
+ 
+@@ -270,12 +269,6 @@ impl RepositoryExtended for gix::Reposit
+     }
+ 
+     fn rev_parse_single_ex(&self, spec: &str) -> Result<gix::Id<'_>> {
+-        use gix::{
+-            object::find::existing::Error as ObjectFindError,
+-            reference::find::existing::Error as RefFindError,
+-            revision::spec::parse::single::Error as SingleError,
+-        };
+-
+         use crate::patch::revspec::Error;
+ 
+         // Catch revspec ranges early because gitoxide will only flag this as 
an error if
+@@ -288,27 +281,15 @@ impl RepositoryExtended for gix::Reposit
+             .into());
+         }
+ 
+-        self.rev_parse_single(spec)
+-            .map_err(|single_err| -> anyhow::Error {
+-                // Distinguish "the spec parsed but resolved to nothing" from 
"the spec
+-                // is malformed" by looking for a typed NotFound frame 
anywhere in the
+-                // error tree underlying SingleError::Parse.
+-                if let SingleError::Parse(ref gix_err) = single_err {
+-                    let not_found = gix_err.iter_errors().any(|src| {
+-                        matches!(
+-                            src.downcast_ref::<RefFindError>(),
+-                            Some(RefFindError::NotFound { .. })
+-                        ) || matches!(
+-                            src.downcast_ref::<ObjectFindError>(),
+-                            Some(ObjectFindError::NotFound { .. })
+-                        )
+-                    });
+-                    if not_found {
+-                        return 
Error::RevisionNotFound(spec.to_string()).into();
+-                    }
+-                }
+-                Error::InvalidRevision(spec.to_string(), 
single_err.to_string()).into()
+-            })
++        self.rev_parse_single(spec).map_err(|err| -> anyhow::Error {
++            // Distinguish "the spec parsed but resolved to nothing" from 
"the spec
++            // is malformed".
++            if err.is_not_found() {
++                Error::RevisionNotFound(spec.to_string()).into()
++            } else {
++                Error::InvalidRevision(spec.to_string(), 
err.to_string()).into()
++            }
++        })
+     }
+ 
+     fn get_comment_symbol(&self) -> String {
+--- a/src/ext/time.rs
++++ b/src/ext/time.rs
+@@ -70,7 +70,16 @@ mod tests {
+ 
+     #[test]
+     fn test_parse_raw_notz() {
+-        let time = Time::parse_time("123456").unwrap();
++        let time = Time::parse_time("1641479527").unwrap();
++        assert_eq!(time.seconds, 1641479527);
++        assert_eq!(time.offset, 0);
++    }
++
++    #[test]
++    fn test_parse_short_epoch() {
++        // Like git, a bare number needs at least 9 digits to be read as 
epoch seconds.
++        assert!(Time::parse_time("123456").is_err());
++        let time = Time::parse_time("@123456").unwrap();
+         assert_eq!(time.seconds, 123456);
+         assert_eq!(time.offset, 0);
+     }
+--- a/src/hook.rs
++++ b/src/hook.rs
+@@ -66,9 +66,10 @@ pub(crate) fn run_pre_commit_hook(repo:
+ 
+     let work_dir = repo.workdir().expect("not a bare repo");
+ 
+-    let mut hook_command = std::process::Command::from(
++    let mut hook_command = std::process::Command::try_from(
+         
gix::command::prepare(hook_path).stdout(std::process::Stdio::inherit()),
+-    );
++    )
++    .with_context(|| format!("`{hook_name}` hook"))?;
+     hook_command.current_dir(work_dir);
+     if !use_editor {
+         hook_command.env("GIT_EDITOR", ":");
+@@ -117,9 +118,10 @@ pub(crate) fn run_commit_msg_hook<'repo>
+ 
+     // TODO: when git runs this hook, it only sets GIT_INDEX_FILE and 
sometimes
+     // GIT_EDITOR. So author and committer vars are not clearly required.
+-    let mut hook_command = std::process::Command::from(
++    let mut hook_command = std::process::Command::try_from(
+         
gix::command::prepare(hook_path).stdout(std::process::Stdio::inherit()),
+-    );
++    )
++    .with_context(|| format!("`{hook_name}` hook"))?;
+     hook_command.current_dir(work_dir);
+     hook_command.env("GIT_INDEX_FILE", &index_path);
+     if !use_editor {
diff -Nru stgit-2.6.1/debian/patches/series stgit-2.6.1/debian/patches/series
--- stgit-2.6.1/debian/patches/series   2026-09-18 14:52:05.000000000 -0500
+++ stgit-2.6.1/debian/patches/series   2026-10-09 22:02:18.000000000 -0500
@@ -4,3 +4,4 @@
 use_winnow_0_7
 gix-0.87.patch
 reject-lone-at-partial-ref.patch
+gix-0.89.patch

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to