worktree finish prints a git fatal because the .cc-os symlink is not ignored #649
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#649
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
worktree finish leaks a git fatal line on untracked-only removal
Problem
#645 merge verification on 2026-09-23 found that
plugins/os/bin/worktree finishprints a fatal git error even though it completes successfully and removes the worktree. The real cause is inplugins/os/lib/worktree/removal.rb, not.gitignore:Removal#callrunsgit worktree removewith bare system (stderr leaks the fatal), then retries with--forcewhenuntracked_only_linked?is true.Cases
.cc-ossymlink, whenworktree finishruns, then no git fatal line reaches stderr or stdout.--forceattempt too, whenworktree finishruns, then the real failure is still surfaced to the operator.Approach
Capture the first
git worktree removeattempt's output via Open3 instead of bare system. Surface stderr only when the final attempt also fails, or skip straight to--forcewhenuntracked_only_linked?is already true.Required work:
Removal#callto use Open3 for the first attempt and suppress its stderr unless the retry also fails — check:plugins/os/bin/worktree finish ticket-649 2>&1 | grep fatal(expect no match on the untracked-only-linked path)Acceptance criteria
.cc-ossymlink, whenworktree finishruns, then it reports success with no fatal line in stderr or stdout.worktree finishruns, then the operator sees the git failure.Non-goals
.gitignoreis unchanged; the trailing-slash pattern is not the cause.Origin
Resolution
Done: Removal skips straight to --force when only linked entries are untracked and captures git stderr with Open3, so finish prints no fatal
Evidence: commit
1c25318f; plugins/os tests 22 runs 0 failures; the next two worktree finish runs printed no fatal lineFollow-ups: none