Skip to content

fix: exclude VCS metadata directories from copy-ignored#1250

Merged
max-sixty merged 2 commits intomainfrom
fix/copy-ignored-skip-vcs-dirs
Mar 4, 2026
Merged

fix: exclude VCS metadata directories from copy-ignored#1250
max-sixty merged 2 commits intomainfrom
fix/copy-ignored-skip-vcs-dirs

Conversation

@worktrunk-bot
Copy link
Copy Markdown
Collaborator

Summary

  • wt step copy-ignored now skips VCS metadata directories (.jj, .hg, .svn, .sl, .bzr, .pijul) that are colocated with git
  • These directories contain internal state tied to a specific working directory — copying them between worktrees breaks the colocated VCS (e.g., Jujutsu re-adds hidden files after seeing a stale .jj directory)
  • Git's own .git is implicitly excluded (never reported by git ls-files), but other colocated VCS tools need explicit exclusion

Closes #1249

Test plan

  • New integration test test_copy_ignored_skips_vcs_metadata_dirs verifies .jj and .hg are excluded while regular ignored files (.env) are still copied
  • All 33 existing copy-ignored tests pass unchanged
  • Clippy clean
  • Doc sync passes (step.md and skill reference updated automatically)

🤖 Generated with Claude Code

github-actions Bot and others added 2 commits March 3, 2026 22:30
`wt step copy-ignored` now skips VCS metadata directories (.jj, .hg,
.svn, .sl, .bzr, .pijul) that are colocated with git. These directories
contain internal state tied to a specific working directory and copying
them between worktrees breaks the colocated VCS.

Closes #1249

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@max-sixty
Copy link
Copy Markdown
Owner

is there any distinction between .git/info/exclude and ignore? I'm less familiar with this difference.

@worktrunk-bot
Copy link
Copy Markdown
Collaborator Author

They're both sources of ignore patterns that --exclude-standard combines, but scoped differently:

  • .gitignore — tracked in the repo, shared with collaborators. The common one (node_modules/, target/, etc.)
  • .git/info/exclude — local to the repo, not tracked/shared. For patterns you want to ignore personally without putting them in .gitignore
  • Global excludes (core.excludesFile) — user-wide, applies to all repos (e.g. .DS_Store)

In practice, .git/info/exclude is where someone running e.g. jj colocated might put .jj/ to keep it out of git status without modifying the shared .gitignore. All three feed into the same git ls-files --ignored --exclude-standard call, so copy-ignored sees them identically — the distinction is just about where the pattern lives.

That said, this doc line predates this PR — I can simplify it to just say "Handles all gitignore sources (.gitignore, global excludes, .git/info/exclude)" or similar if you'd prefer a clearer phrasing.

@max-sixty max-sixty merged commit 070e23f into main Mar 4, 2026
22 checks passed
@max-sixty max-sixty deleted the fix/copy-ignored-skip-vcs-dirs branch March 4, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files in .git/info/exclude are no longer hidden after wt switch if using jj

2 participants