Skip to content

refactor: port the git log function from CLI to git2#281

Closed
Scott McMaster (scottmcmaster) wants to merge 3 commits into
developfrom
scott-port-log-to-git2
Closed

refactor: port the git log function from CLI to git2#281
Scott McMaster (scottmcmaster) wants to merge 3 commits into
developfrom
scott-port-log-to-git2

Conversation

@scottmcmaster

@scottmcmaster Scott McMaster (scottmcmaster) commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Moved the log function for git from the CLI subprocess to modern git2 native rust code.

It also seems like there are a bunch of rustfmt errors on the develop branch right now that got auto-fixed.

Test Plan

New unit testing for this.

  • No test plan needed

Docs

  • Docs updated (companion PR in darkmatter/nixmac-web: #___)
  • No docs update needed

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Scott McMaster (scottmcmaster) commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • automerge - adds this PR to the back of the merge queue
  • urgent - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📋 PR Overview

Lines changed 143 (+90 / -53)
Files 0 added, 6 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
No Test Plan Needed no
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

🔬 Coverage

Report Lines Statements Functions Branches
apps/native/coverage/coverage-summary.json 26.2% 26.4% 24.3% 17.9%

Generated by 🚫 dangerJS against 8dcb5d5

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Ports commit history retrieval from the Git CLI subprocess approach to native git2-based querying, and includes incidental rustfmt cleanup across several Rust files.

Changes:

  • Switched history/summarization pipelines to call crate::git::query::log(...) instead of crate::git::log(...).
  • Implemented a new git2-backed log() in apps/native/src-tauri/src/git/query.rs with a unit test.
  • Removed the old CLI-based log() implementation and applied formatting-only cleanups in a few modules.

Reviewed changes

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

Show a summary per file
File Description
apps/native/src-tauri/src/summarize/pipelines/history.rs Updates summarization history pipeline to use the new git2 log query.
apps/native/src-tauri/src/shared_types/system.rs Removes trailing whitespace line (format-only).
apps/native/src-tauri/src/history/get_history.rs Updates history query to use the new git2 log query.
apps/native/src-tauri/src/git/query.rs Adds git2 implementation of log() plus a unit test.
apps/native/src-tauri/src/git/mod.rs Stops re-exporting the removed CLI log() function from exec.
apps/native/src-tauri/src/git/exec.rs Removes the CLI-based log() implementation and an unused helper method.
apps/native/src-tauri/src/evolve/search_packages.rs Formatting-only changes (line wrapping).
apps/native/src-tauri/src/evolve/providers/ollama.rs Formatting-only changes (line wrapping).
apps/native/src-tauri/src/commands/settings_io.rs Removes stray blank lines (format-only).
apps/native/src-tauri/src/commands/permissions.rs Removes trailing whitespace line (format-only).

Comment thread apps/native/src-tauri/src/git/query.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So much nicer! 👏

Base automatically changed from 06-02-scott-nix-diffs-refactor to develop June 5, 2026 00:19
@czxtm cooper (czxtm) force-pushed the scott-port-log-to-git2 branch from 5175c7c to 269a451 Compare June 5, 2026 00:19
@graphite-app

graphite-app Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jun 5, 12:20 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Jun 5, 12:29 AM UTC: czxtm added this pull request to the Graphite merge queue.
  • Jun 5, 12:30 AM UTC: CI is running for this pull request on a draft pull request (#318) due to your merge queue CI optimization settings.
  • Jun 5, 12:33 AM UTC: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI (build)).
  • Jun 5, 1:30 AM UTC: czxtm added this pull request to the Graphite merge queue.
  • Jun 5, 1:31 AM UTC: CI is running for this pull request on a draft pull request (#321) due to your merge queue CI optimization settings.
  • Jun 5, 1:37 AM UTC: Merged by the Graphite merge queue via draft PR: #321.

@graphite-app graphite-app Bot closed this Jun 5, 2026
@graphite-app graphite-app Bot deleted the scott-port-log-to-git2 branch June 5, 2026 01:37
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.

4 participants