Skip to content

refactor: migrate intent_add_untracked to git2, setting INTENT_TO_ADD flag without shelling out#310

Closed
Scott McMaster (scottmcmaster) wants to merge 4 commits into
06-03-scott-kill-git-stashfrom
06-04-scott-port-intent-to-add-to-git2
Closed

refactor: migrate intent_add_untracked to git2, setting INTENT_TO_ADD flag without shelling out#310
Scott McMaster (scottmcmaster) wants to merge 4 commits into
06-03-scott-kill-git-stashfrom
06-04-scott-port-intent-to-add-to-git2

Conversation

@scottmcmaster

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

Copy link
Copy Markdown
Collaborator

Summary

Port intent_add_untracked from CLI to git2, with comments noting a few minor complexities.

Test Plan

Existing unit tests (of which there were some) passed, also added a couple new tests, and did manual testing with things like "add a new .nix file to my configuration" and verify that it passes build check and build.

  • 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 4, 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) marked this pull request as ready for review June 4, 2026 02:23
@scottmcmaster Scott McMaster (scottmcmaster) changed the title scott-port-intent-to-add-to-git2 refactor: migrate intent_add_untracked to git2, setting INTENT_TO_ADD flag without shelling out Jun 4, 2026

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 refactors intent_add_untracked (used to make untracked config files visible to Nix flake evaluation) to use git2 instead of shelling out to the Git CLI, and expands unit test coverage for the new behavior.

Changes:

  • Replaced CLI-based discovery (git ls-files --others) and intent staging (git add -N) with a git2 implementation that sets INTENT_TO_ADD index entries pointing at the empty blob.
  • Added unit tests verifying the INTENT_TO_ADD flag behavior, ignored-file filtering, and support for repos without a HEAD commit.
  • Minor formatting cleanups in existing tests.

Comment thread apps/native/src-tauri/src/git/exec.rs
Comment thread apps/native/src-tauri/src/git/exec.rs Outdated
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

📋 PR Overview

Lines changed 241 (+209 / -32)
Files 0 added, 1 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.3% 26.5% 24.3% 17.9%

Generated by 🚫 dangerJS against 25a56f9

@czxtm cooper (czxtm) force-pushed the 06-03-scott-kill-git-stash branch from dc8d1d2 to 526f541 Compare June 4, 2026 11:47
@czxtm cooper (czxtm) force-pushed the 06-04-scott-port-intent-to-add-to-git2 branch from 2678915 to 6014387 Compare June 4, 2026 11:50
@graphite-app

graphite-app Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • 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 removed this pull request due to downstack failures on PR #281.
  • Jun 5, 12:33 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #281.
  • 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.

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