Repository navigation
Git pane: file-level staging before commit and merge - #676
Merged
currentbits merged 1 commit intoAug 23, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/fork-file-and-hunk-level-staging-before--5b3173
branch
October 3, 2026 16:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit and merge now land only the files you check in the Changes panel. Hunk-level staging is still the follow-up the issue named.
What changed
UI (
src/components/ThreadView.tsx,ThreadView.module.css)Backend (
electron/worktrees.js,electron/ipc.js,src/shared/ipc.ts,src/useCoder.ts)git.commitandgit.mergeWorktreetake an optionalpaths[]. Omitted = the oldgit add -Abehaviour, so every existing caller is unchanged.git add -A -- <paths>/git commit -- <paths>.useCoderremembers the pane's staged list per thread so a Git-tab merge stages the same subset.Path validation
assertRelPathInCwdrejects empty, absolute,..-escaping and leading-dash pathspecs (git reads those as flags even after--).revertFilenow routes through it too, replacing its own inline copy.Merge safety
paths,mergeWorktreere-checksgit status --porcelain -uallafter the session commit and refuses the merge if anything dirty remains, listing the files. The worktree is never deleted with uncommitted work.Known gaps
Size
623 lines across 10 files, over the 400 cap; opened with allowOversize by explicit user decision. ~270 of those lines are the new tests, and the backend and UI halves only make sense reviewed together.
Verification
Run in the worker's worktree:
npx tsc --noEmit— cleantest/changesPanel.test.tsx— 8/8 passelectron/test/worktrees-commit.test.js+electron/test/worktrees.test.js— 62/62 pass