Skip to content

refactor: migrate commit_all and create_evolution_backup staging to git2, kill git_command wrapper#319

Merged
cooper (czxtm) merged 2 commits into
developfrom
06-05-scott-port-commit-all-to-git2-and-remove-cli
Jun 6, 2026
Merged

refactor: migrate commit_all and create_evolution_backup staging to git2, kill git_command wrapper#319
cooper (czxtm) merged 2 commits into
developfrom
06-05-scott-port-commit-all-to-git2-and-remove-cli

Conversation

@scottmcmaster

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

Copy link
Copy Markdown
Collaborator

Summary

This is the last change before we can get rid of the GitCommand CLI wrapper struct, namely to port commit_allover to git2. The biggest change was in staging, so that gets is own helper. Added several unit tests to verify the previous behavior provided by flags in the old CLI command implementation (around signing, names, hooks).

Test Plan

Existing and new unit tests pass.

  • No test plan needed

Docs

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

Scott McMaster (scottmcmaster) commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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.

@scottmcmaster Scott McMaster (scottmcmaster) changed the title scott-port-commit-all-to-git2-and-remove-cli refactor: migrate commit_all and create_evolution_backup staging to git2, kill git_command wrapper Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

📋 PR Overview

Lines changed 373 (+256 / -117)
Files 0 added, 2 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 25.9% 26.1% 24.2% 17.7%

Generated by 🚫 dangerJS against db9b747

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

This PR completes the migration away from the GitCommand CLI wrapper by porting commit_all (and the staging portion of create_evolution_backup) to git2/libgit2, aligning git mutations around repository object/index operations rather than shelling out to git.

Changes:

  • Removed the GitCommand/git_command() CLI wrapper from the git execution layer.
  • Added a shared stage_all() helper that emulates git add -A using git2 index operations, and used it in commit_all and create_evolution_backup.
  • Added unit tests covering commit identity, staging semantics (including ignored/untracked/tracked deletions), nested-directory invocation behavior, and hook non-execution.

Reviewed changes

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

File Description
apps/native/src-tauri/src/git/query.rs Minor doc/comment adjustment in query-layer ref/HEAD resolution notes.
apps/native/src-tauri/src/git/exec.rs Migrates commit_all + backup staging to git2 via stage_all(), removes CLI wrapper, and adds targeted unit tests for prior CLI semantics.

@graphite-app graphite-app Bot changed the base branch from 06-04-scott-port-git-clean-fd-funcs to graphite-base/319 June 5, 2026 01:37
@scottmcmaster Scott McMaster (scottmcmaster) force-pushed the 06-05-scott-port-commit-all-to-git2-and-remove-cli branch from a31d2e5 to 659971d Compare June 5, 2026 03:26
@scottmcmaster Scott McMaster (scottmcmaster) changed the base branch from graphite-base/319 to 06-04-scott-port-git-clean-fd-funcs June 5, 2026 03:26
@scottmcmaster Scott McMaster (scottmcmaster) force-pushed the 06-05-scott-port-commit-all-to-git2-and-remove-cli branch from 659971d to 3fda913 Compare June 5, 2026 04:59
@scottmcmaster Scott McMaster (scottmcmaster) force-pushed the 06-04-scott-port-git-clean-fd-funcs branch from fc3c5dc to 04ba33e Compare June 5, 2026 04:59
@graphite-app graphite-app Bot changed the base branch from 06-04-scott-port-git-clean-fd-funcs to graphite-base/319 June 5, 2026 05:10
@graphite-app graphite-app Bot force-pushed the 06-05-scott-port-commit-all-to-git2-and-remove-cli branch from 3fda913 to 257b0fe Compare June 5, 2026 05:11
@graphite-app graphite-app Bot force-pushed the graphite-base/319 branch from 04ba33e to 0896d06 Compare June 5, 2026 05:11
@graphite-app graphite-app Bot changed the base branch from graphite-base/319 to develop June 5, 2026 05:11
@graphite-app graphite-app Bot force-pushed the 06-05-scott-port-commit-all-to-git2-and-remove-cli branch from 257b0fe to 4f6c086 Compare June 5, 2026 05:12

Copy link
Copy Markdown
Member

🙌

@czxtm cooper (czxtm) added this pull request to the merge queue Jun 6, 2026
Merged via the queue into develop with commit eb3258f Jun 6, 2026
16 checks passed
@czxtm cooper (czxtm) deleted the 06-05-scott-port-commit-all-to-git2-and-remove-cli branch June 6, 2026 23:21
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