Skip to content

Conversation

blinxen
Copy link
Contributor

@blinxen blinxen commented Jul 20, 2025

This PR tries to update gix to version 0.73.

The changes were needed because of:

  • SignatureRef.time method now returns a &str. There is a SignatureRef.time() to get Time back. This can however fail and return an Error. I replaced all instances where time was accessed directly with time()?. In one case, I couldn't use the ? operator because the method did not return a Result. How do you want this to be handled? Is there some default value that can be used here? The compile error looks like this:
> cargo b
   Compiling stgit v2.5.3 (/home/hka/dev/opensource/stgit)
error[E0308]: mismatched types
  --> src/ext/signature.rs:49:24
   |
49 |             .unwrap_or(self.time);
   |              --------- ^^^^^^^^^ expected `Time`, found `&str`
   |              |
   |              arguments to this method are incorrect
   |
help: the return type of this call is `&str` due to the type of the argument passed
  --> src/ext/signature.rs:46:20
   |
46 |           let time = matches
   |  ____________________^
47 | |             .get_one::<gix::date::Time>("authdate")
48 | |             .copied()
49 | |             .unwrap_or(self.time);
   | |________________________---------^
   |                          |
   |                          this argument influences the return type of `unwrap_or`
note: method defined here
  --> /builddir/build/BUILD/rust-1.88.0-build/rustc-1.88.0-src/library/core/src/option.rs:1023:12
  • SignatureRef.to_owned() can now fail and needs to handled accordingly (by using the ? operator).
  • RepositoryExtended.commit_ex() wants a SignatureRef but Signature was passed. I assume that because of the updated somewhere Signature is returned instead of SignatureRef. I added a couple of Signature.to_ref calls where needed.

@jpgrayson
Copy link
Collaborator

Hi @blinxen. Thank you for trying to make this gix update happen. This kind of breaking change is fairly typical and usually requires rearranging some things in stgit to accommodate.

I do not have the bandwidth to look into this anytime soon. Apologies for that. I will get to it eventually, but it would be amazing if you or others could figure out a path forward.

@jpgrayson
Copy link
Collaborator

Update: I've got a patch that accommodate the breaking changes in gix 0.73. The bad news is that there is a change in gix::date::parse() that causes a regression in StGit.

I've posted an issue upstream: GitoxideLabs/gitoxide#2095

It is possible to work around the regression by not using gix for date parsing, but I'm hoping we can get an upstream fix.

@blinxen
Copy link
Contributor Author

blinxen commented Aug 3, 2025

Thanks for looking into this! The gitoxide maintainer released a new version which I hope fixes the issue you mentioned.

@jpgrayson
Copy link
Collaborator

This is done as of 41aeda5.

The needed fixes went into gix-date 0.10.5.

@jpgrayson jpgrayson closed this Aug 11, 2025
@blinxen
Copy link
Contributor Author

blinxen commented Aug 11, 2025

Thank you very much for following on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants