split: fails when planned file is untracked/unstaged
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14
- Forks
- 1
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 16
Description
Summary
coco commit --split fails when a file included in the generated split plan is itself untracked or has unstaged changes. This creates a chicken-and-egg problem when coco's own config file (.coco.json) is part of the commit.
Steps to Reproduce
- Have a repo with staged changes and an untracked
.coco.jsonfile - Run
coco commit --split - Coco generates a split plan that includes
.coco.jsonas one of the files to commit - User confirms the plan
- Coco errors out:
Error: Cannot apply split plan because these files also have unstaged or untracked changes: .coco.json
Expected Behavior
Coco should be able to commit files that are in the split plan even if they're currently untracked. If a file is part of the plan, coco should stage it before applying the commit rather than treating it as a conflict.
Possible Solutions
- Auto-stage files that are part of the approved plan before applying commits
- Skip the dirty-check for files that are explicitly included in the plan
- Exclude untracked files from the plan if they can't be handled, with a clear message
Environment
- coco version: latest
- OS: macOS
- Node: v22.14.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the coco commit --split command and the dirty-check that produces the reported conflict for .coco.json; reproduce it with staged changes and an untracked or unstaged planned file. Done means a file explicitly included in the approved split plan can be committed without triggering the unstaged or untracked conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100