Expand description
Change worktree initialization: file copy-over and include-pattern resolution. Change worktree initialization: file copy-over, setup command execution, and include-pattern resolution.
Resolves include patterns from two sources:
worktrees.init.includein the Ito config — a list of glob patterns..worktree-includefile at the repo root — one glob per line,#-prefixed comment lines and blank lines are ignored.
The union of both sources is used. Patterns are expanded against the source worktree root and matched files are copied into the destination worktree.
After file copy, an optional setup command (or list of commands) from
worktrees.init.setup is executed inside the new worktree.
Functions§
- copy_
include_ files - Copy matched include files from
source_rootintodest_root, preserving relative paths. - init_
worktree - Initialize a new change worktree: copy include files, then run setup commands.
- parse_
worktree_ include_ file - Parse a
.worktree-includefile into a list of non-empty, non-comment lines. - resolve_
include_ files - Resolve all include patterns from config and the
.worktree-includefile, then expand them againstsource_rootand return the set of matching relative paths (deduplicated, sorted). - run_
worktree_ setup - Run the configured setup command(s) inside
worktree_root.