Skip to content

Improve comment in object/commit.rs#2583

Merged
Sebastian Thiel (Byron) merged 1 commit into
GitoxideLabs:mainfrom
tisonkun:patch-1
May 7, 2026
Merged

Improve comment in object/commit.rs#2583
Sebastian Thiel (Byron) merged 1 commit into
GitoxideLabs:mainfrom
tisonkun:patch-1

Conversation

@tisonkun

Copy link
Copy Markdown
Contributor

cc Sebastian Thiel (@Byron)

Commit now has an author method as well:

    /// Return the commits author, with surrounding whitespace trimmed.
    pub fn author(&self) -> Result<gix_actor::SignatureRef<'_>, gix_object::decode::Error> {
        gix_object::CommitRefIter::from_bytes(&self.data, self.id.kind())
            .author()
            .map(|s| s.trim())
    }

Seems we don't need to decode first? Or else the API looks unintuitive to understand.

Copilot AI review requested due to automatic review settings May 7, 2026 13:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Commit::time()’s documentation to point to the newer Commit::author() API for authored timestamps, avoiding the previously suggested .decode()? detour and making the intended usage clearer and more consistent with the rest of the Commit convenience methods.

Changes:

  • Adjust doc comment for Commit::time() to reference .author()?.time() instead of .decode()?.author()?.time().

@Byron Sebastian Thiel (Byron) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch!

@Byron Sebastian Thiel (Byron) merged commit a791ea3 into GitoxideLabs:main May 7, 2026
35 of 36 checks passed
@tisonkun tison (tisonkun) deleted the patch-1 branch May 7, 2026 16:05
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.

3 participants