-
-
Notifications
You must be signed in to change notification settings - Fork 354
gix-actor docs: document conversions between Signature
and SignatureRef
#2038
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
Conversation
I also noticed that there exists Then there's I'm also not sure whether the fact that the |
Adapt to changes in `gix-actor::Signature` and `gix-actor::SignatureRef`. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix-actor::SignatureRef` and either `gix-actor::Signature` or jj's `Signature` types can now fail. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
Adapt to changes in `gix-actor::Signature` and `gix-actor::SignatureRef`. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix-actor::SignatureRef` and either `gix-actor::Signature` or jj's `Signature` types can now fail. We use the epoch for the time if the timestamp is unreadable, like gix did before. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
Update `gix` to 0.72.1, and adapt to its breaking changes. 1. Adapt to a change in signature of `gix::reference::iter::Platform::prefixed` that seems to confuse Rust compiler. 2. Adapt to `git_object::Tree::EntryMode` API change; `entry.mode()` now has a `value()` method. 3. Most significantly, adapt to the changes to `gix::actor::SignatureRef`. ## Details about `gix::actor::SignatureRef` The API for `gix::actor::Signature` and `gix::actor::SignatureRef` changedd. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix::actor::SignatureRef` and either `gix::actor::Signature` or jj's `Signature` types can now fail. We use the epoch for the time if the timestamp is unreadable, like gix did before. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
Update `gix` to 0.72.1, and adapt to its breaking changes. 1. Adapt to a change in signature of `gix::reference::iter::Platform::prefixed` that seems to confuse Rust compiler. 2. Adapt to `git_object::Tree::EntryMode` API change; `entry.mode()` now has a `value()` method. 3. Most significantly, adapt to the changes to `gix::actor::SignatureRef`. ## Details about `gix::actor::SignatureRef` The API for `gix::actor::Signature` and `gix::actor::SignatureRef` changedd. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix::actor::SignatureRef` and either `gix::actor::Signature` or jj's `Signature` types can now fail. We use the epoch for the time if the timestamp is unreadable, like gix did before. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
Update `gix` to 0.72.1, and adapt to its breaking changes. 1. Adapt to a change in signature of `gix::reference::iter::Platform::prefixed` that seems to confuse Rust compiler. 2. Adapt to `git_object::Tree::EntryMode` API change; `entry.mode()` now has a `value()` method. 3. Most significantly, adapt to the changes to `gix::actor::SignatureRef`. ## Details about `gix::actor::SignatureRef` The API for `gix::actor::Signature` and `gix::actor::SignatureRef` changedd. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix::actor::SignatureRef` and either `gix::actor::Signature` or jj's `Signature` types can now fail. We use the epoch for the time if the timestamp is unreadable, like gix did before. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
Update `gix` to 0.72.1, and adapt to its breaking changes. 1. Adapt to a change in signature of `gix::reference::iter::Platform::prefixed` that seems to confuse Rust compiler. 2. Adapt to `git_object::Tree::EntryMode` API change; `entry.mode()` now has a `value()` method. 3. Most significantly, adapt to the changes to `gix::actor::SignatureRef`. ## Details about `gix::actor::SignatureRef` The API for `gix::actor::Signature` and `gix::actor::SignatureRef` changedd. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix::actor::SignatureRef` and either `gix::actor::Signature` or jj's `Signature` types can now fail. We use the epoch for the time if the timestamp is unreadable, like gix did before. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
Update `gix` to 0.72.1, and adapt to its breaking changes. 1. The signature of `gix::reference::iter::Platform::prefixed` changed in a way that seems to confuse Rust compiler (and does confuse me). 2. `git_object::Tree::EntryMode` API changed; `entry.mode()` now has a `value()` method. 3. Most significantly, the meaning and API of `gix::actor::SignatureRef` changed. ## Details about `gix::actor::SignatureRef` The API for `gix::actor::Signature` and `gix::actor::SignatureRef` changedd. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix::actor::SignatureRef` and either `gix::actor::Signature` or jj's `Signature` types can now fail. We use the epoch for the time if the timestamp is unreadable, like gix did before. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
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.
Thanks a lot for improving the documentation!
I did edit it as suggested, mainly to be more specific where possible.
Then there's
impl From<SignatureRef<'_>> for Signature {
, which I perhaps should use instead ofSignatureRef::to_owned()
(perhaps that should be calledparse
?). I thought this was aTryFrom
(Update: this is what the changelog for gix-actor said), but I guess that changed (or my IDE failed to find the TryFrom).
For consistency, one could add a TryFrom
that calls to_owned()
under the hood.
I prefer to_owned()
if given the choice as I don't find try_from()
very discoverable, but that might also be affected by the IDE.
Please feel free to submit a PR for that though.
Update `gix` to 0.72.1, and adapt to its breaking changes. 1. The signature of `gix::reference::iter::Platform::prefixed` changed in a way that seems to confuse Rust compiler (and does confuse me). 2. `git_object::Tree::EntryMode` API changed; `entry.mode()` now has a `value()` method. 3. Most significantly, the meaning and API of `gix::actor::SignatureRef` changed. ## Details about `gix::actor::SignatureRef` The API for `gix::actor::Signature` and `gix::actor::SignatureRef` changedd. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix::actor::SignatureRef` and either `gix::actor::Signature` or jj's `Signature` types can now fail. We use the epoch for the time if the timestamp is unreadable, like gix did before. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
Update `gix` to 0.72.1, and adapt to its breaking changes. 1. The signature of `gix::reference::iter::Platform::prefixed` changed in a way that seems to confuse Rust compiler (and does confuse me). 2. `git_object::Tree::EntryMode` API changed; `entry.mode()` now has a `value()` method. 3. Most significantly, the meaning and API of `gix::actor::SignatureRef` changed. ## Details about `gix::actor::SignatureRef` The API for `gix::actor::Signature` and `gix::actor::SignatureRef` changedd. The latter now contains an unparsed string time field, while the former still contains a parsed time. So, the conversions between `gix::actor::SignatureRef` and either `gix::actor::Signature` or jj's `Signature` types can now fail. We use the epoch for the time if the timestamp is unreadable, like gix did before. Cc: GitoxideLabs/gitoxide#1935, GitoxideLabs/gitoxide#2038
Thank you very much for the review! Your edits are also great; the final result seems clear and helpful. |
These are some docs that could have been helpful as I am adapting
jj
to #1935. Please feel free to edit them further.I guess a part of this PR is a question: did I figure out correctly how I'm supposed to use these?
See also #1935 (comment). I wonder if some of these classes and methods should be renamed. (Perhaps it's possible to make the old name a deprecated type alias?)