feat: default to nested layout, add .gitignore at install time#2
Merged
feat: default to nested layout, add .gitignore at install time#2
Conversation
added 6 commits
April 13, 2026 17:42
Declares modifies_hooks in extension.yml so that installing this extension automatically disables the git extension's before_specify -> speckit.git.feature hook (with explicit user consent). This keeps the primary checkout on a stable branch while worktrees handle feature branch isolation. Requires: github/spec-kit#2209 (modifies_hooks support) Made-with: Cursor
Worktrees now default to .worktrees/<branch>/ inside the repo (gitignored, self-contained) instead of sibling directories. Sibling layout remains available via layout: "sibling" in config. BREAKING: Existing users relying on the sibling default will need to add layout: "sibling" to their worktree-config.yml to preserve the old behavior. Made-with: Cursor
- post-install.sh adds .worktrees/ to .gitignore immediately on extension install, not just at first worktree creation - README "How worktrees stay isolated" section explains gitignore timing, commit isolation, and cleanup behavior Made-with: Cursor
- test-create-worktree.sh: 12 tests (22 assertions) covering dry-run, nested/sibling layouts, --in-place, --path, env override, real worktree creation, duplicate blocking, config override, slash sanitization - test-post-install.sh: 5 tests (6 assertions) covering gitignore creation, idempotency, custom dotworktrees_dir, absent .gitignore, preserving existing content - Add tests/ to .extensionignore (excluded from installs) Made-with: Cursor
- Runs test-create-worktree.sh and test-post-install.sh on push to main and on pull requests - Matrix: ubuntu-latest + macos-latest - Add test status badge to README Made-with: Cursor
Made-with: Cursor
dango85
added a commit
that referenced
this pull request
Apr 15, 2026
feat: default to nested layout, add .gitignore at install time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three changes for v1.2.0:
1. Default layout changed from
siblingtonestedWorktrees now default to
.worktrees/<branch>/inside the repo instead of sibling directories. This is self-contained, gitignored, and matches the convention used by the communityworktreeextension.Existing users who prefer sibling layout add one line to config:
2.
.gitignoreupdated at install timeNew
post_installlifecycle script adds.worktrees/to.gitignoreimmediately when the extension is installed — not just at first worktree creation. This prevents worktree directories from ever being accidentally committed to the main repo.The create script retains its
.gitignorecheck as a safety net.3. Test suites
--in-place,--path, env override, real worktree creation + branch verification, duplicate path blocking, config file override, slash sanitizationdotworktrees_dir, absent.gitignore, preserving existing contentAll 28 assertions pass.
4. Documentation: "How worktrees stay isolated"
New README section explains the full isolation model:
.gitignoretiming (install + create)git add/commitonly affects its branch)Files changed
extension.yml— default layoutnested, version 1.2.0,lifecycle.post_installworktree-config.yml— ships withlayout: "nested"scripts/bash/create-worktree.sh— fallback default changed tonestedscripts/bash/post-install.sh— new: adds.worktrees/to.gitignoreon installcommands/speckit.worktrees.create.md— config table updatedREADME.md— nested first, isolation section addedCHANGELOG.md— 1.2.0 entrytests/test-create-worktree.sh— new: 22 assertionstests/test-post-install.sh— new: 6 assertions.extensionignore— excludestests/from installs