Skip to content

fix(commit): split staging failures and AI grouping spinner layout - #85

Merged
maxbolgarin merged 2 commits into
mainfrom
claude/epic-curie-s7zjle
Oct 20, 2026
Merged

maxbolgarin merged 2 commits into
mainfrom
claude/epic-curie-s7zjle

Conversation

@maxbolgarin

@maxbolgarin maxbolgarin commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Two fixes in the commit split flow (gitb c ff and friends).

Split staging (✗ Cannot stage files for scope '…')
Each split group used to be restaged by running git add on the worktree copy of its files. That:

  • failed outright when a staged file had since been removed from the worktree (pathspec did not match), or when git couldn't take index.lock. The flow then fell back to one big commit;
  • quietly committed unstaged edits for partially staged files.

Each group is now restaged from the pre-split index tree (git restore --staged --source=<orig tree>), which is exact: partial hunks, deletions, and files gone from the worktree all come through as staged. When staging does fail, git's error is shown and the original index is restored from the tree. A regression test covers this; it fails without the fix.

Spinner layout
A blank line now separates "Grouping changes by feature with AI..." from its spinner, like fetch/pull. The duplicate blank line before the split preview is skipped.

test_commit_*.bats passes except for two test_commit_push_no_dup cases, which fail the same way on the base branch in this sandbox.

🤖 Generated with Claude Code

https://claude.ai/code/session_013XG3b9rDvS5K2grqinUniN

Leave a blank line after "Grouping changes by feature with AI..." so the
spinner and its timer don't sit right under the header, matching the
fetch/pull progress layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013XG3b9rDvS5K2grqinUniN
Each split group was restaged by re-adding the worktree copy of its files.
That failed with "Cannot stage files for scope" when a staged file was
no longer in the worktree (or git hit a lock), and silently committed
unstaged edits for partially staged files.

Restage each group from the pre-split index tree instead, show git's
error when staging fails, and restore the original index exactly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013XG3b9rDvS5K2grqinUniN
@maxbolgarin maxbolgarin changed the title fix(commit): put the AI grouping spinner on its own line fix(commit): split staging failures and AI grouping spinner layout Oct 20, 2026
@maxbolgarin
maxbolgarin merged commit ef8b291 into main Oct 20, 2026
8 checks passed
@maxbolgarin
maxbolgarin deleted the claude/epic-curie-s7zjle branch October 20, 2026 17:01
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 5.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants