worktree finish refuses a committed linked entry; start excludes linked entries from git #789
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#789
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?
Problem
A worktree carries
.cc-osas a symlink to the owning checkout's.cc-osdirectory..gitignorelisted.cc-os/, a directory-only rule, so the symlink was not ignored inside a worktree. Pipeline commits made withgit add -Aincluded the symlink. After the fast-forward to main,.cc-osin the main checkout became a symlink to itself, and everyos-backlogcommand failed until the directory was rebuilt by hand. The same exposure exists for.sdlc/pipeline.dband every extra path listed underworktree-symlinks.Observed
Commits
50947d21(2026-09-26) and1bfea020(2026-09-27, the #786 CRC commit) each added.cc-osas a symlink with target/home/jared/dev/cc-os/.cc-os.Reproduce
With the old
.cc-os/ignore rule the symlink shows as staged. The 2026-09-28 change to.cc-os(no slash) stops this one path but not the other linked entries.Approach
Required work:
Worktree::FinishCommandrefuses to merge whengit diff --name-only <base>..<branch>contains anyLinkedEntriespath, and prints the offending paths — check:ruby plugins/os/tests/all.rbWorktree::StartCommandappends each linked entry to the worktree's.git/info/excludewhen it creates the symlink — check:ruby plugins/os/tests/all.rbRejected: rely on
.gitignorealone — the extras list inworktree-symlinksis per-machine config and cannot be covered by a committed ignore file.Acceptance criteria
LinkedEntriespath, when the user runs worktree finish, then finish exits nonzero, names the path, and main is unchanged.git add -Aruns inside it, then no linked entry is staged.Owner sketch
Origin
os-backlog close 769 ...during the 2026-09-28 diagnosis of the junk "T" tickets.cc-os/configfrom~/.cc-os/projects.json, rangit rm --cached .cc-os, changed the.gitignorerule to.cc-os.cc-osis a self-symlink on main ← fast-forward merged a commit that added the worktree symlink ←.gitignorerule.cc-os/matches directories only ← DESIGN (plugins/os/lib/worktree/start_command.rbsymlink_owning_state, .gitignore line 26)VERDICT: CREATE
Resolution
Done: start writes linked entries to the shared info/exclude; finish refuses with exit 5 when the branch diff touches one
Evidence: commit
ab25f09emerged9f272c2f; three red tests in plugins/os/tests/worktree/; os suite 30 runs 0 failures; note: Required work 2 named the per-worktree exclude, which git ignores, so the shared common-dir exclude was usedFollow-ups: none