Skip to content

refactor: reduce smallvec dep from git-date#2593

Merged
Sebastian Thiel (Byron) merged 3 commits into
GitoxideLabs:mainfrom
tisonkun:reduce-dep
May 12, 2026
Merged

refactor: reduce smallvec dep from git-date#2593
Sebastian Thiel (Byron) merged 3 commits into
GitoxideLabs:mainfrom
tisonkun:reduce-dep

Conversation

@tisonkun
Copy link
Copy Markdown
Contributor

@tisonkun tison (tisonkun) commented May 10, 2026

Resolve TODO when encountering it. Comments inline.

cc Sebastian Thiel (@Byron)

Copilot AI review requested due to automatic review settings May 10, 2026 12:08
Comment thread gix-date/src/parse/mod.rs
Comment thread gix-date/Cargo.toml
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

let time_bytes = self.buf.as_slice();

P1 Badge Slice TimeBuf to the written length

For every Time::to_str() call where the serialized timestamp is shorter than Time::MAX.size(), as_str() now returns the entire fixed-size backing array, including trailing \0 bytes left after clear(). That changes the public string from e.g. "0 +0000" to the same text plus NUL padding, so callers comparing, formatting, or writing commit headers get invalid extra bytes; this should use the tracked idx length when creating time_bytes.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors gix-date’s time serialization buffer to remove the smallvec dependency by replacing SmallVec-backed storage with a fixed-size stack buffer and a custom std::io::Write implementation.

Changes:

  • Replace TimeBuf’s SmallVec<[u8; N]> backing with [u8; N] plus a write index and implement io::Write directly.
  • Remove smallvec from gix-date dependencies and update Cargo.lock accordingly.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
gix-date/src/parse/mod.rs Refactors TimeBuf storage and implements io::Write to eliminate SmallVec.
gix-date/Cargo.toml Drops the smallvec dependency from gix-date.
Cargo.lock Removes smallvec from the resolved dependency list for gix-date.

Comment thread gix-date/src/parse/mod.rs Outdated
Comment thread gix-date/src/parse/mod.rs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Member

@Byron Sebastian Thiel (Byron) left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this.

I left a note that should help steer this to completion.

Comment thread gix-date/Cargo.toml
Copy link
Copy Markdown
Member

@Byron Sebastian Thiel (Byron) left a comment

Choose a reason for hiding this comment

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

Putting it to draft while the comment isn't addressed.

This reminds me of my rule to do these things myself, but here I am far enough down the wrong side of the road so might as well keep passive aggressively repeating myself here 😁.

Comment thread gix-date/src/parse/mod.rs
Copy link
Copy Markdown
Member

@Byron Sebastian Thiel (Byron) left a comment

Choose a reason for hiding this comment

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

Ah, right, sorry for that.
To me it seemed like nothing changed.

It would have helped if there would have been a summary of what you did along with "I think it can be merged now".

@Byron Sebastian Thiel (Byron) marked this pull request as ready for review May 12, 2026 02:16
Copilot AI review requested due to automatic review settings May 12, 2026 02:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

Comment thread gix-date/src/parse/mod.rs
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efaeb714e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread gix-date/src/parse/mod.rs
tison (tisonkun) and others added 2 commits May 12, 2026 10:26
Signed-off-by: tison <wander4096@gmail.com>
- make sure it really can't overflow
Copilot AI review requested due to automatic review settings May 12, 2026 03:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

@Byron Sebastian Thiel (Byron) merged commit 344ef84 into GitoxideLabs:main May 12, 2026
36 checks passed
@tisonkun tison (tisonkun) deleted the reduce-dep branch May 12, 2026 04:09
@tisonkun
Copy link
Copy Markdown
Contributor Author

Sebastian Thiel (@Byron) Thanks for your review and merging. I enjoy this kind of collaboration :D

It would have helped if there would have been a summary of what you did along with "I think it can be merged now".

It's actually included in #2593 (comment), I quote:

Pushed efaeb71 to handle your comment. Hopefully I understand it correctly.

But for sure I can repeat it in the next comment to make it clear :P

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