Expand description
Git worktrees cloned from a per-repository template checkout, sharing disk blocks until written.
macOS clones whole directories with clonefile(2), Linux uses cp --reflink=always (FICLONE)
Structs§
- Options
- What to share and how often to refresh the template from the checkout
Enums§
- Added
- How
add_or_plainmade the worktree
Constants§
- DEFAULT_
SHARE - Hidden directories that hold only build caches, so they are shared like any other ignored directory. Every other path with a hidden component is tool or agent config and stays out
Functions§
- add
- Create
wtby cloningtemplate, refreshed totemplate_startand warmed fromrepofirst.new_branchandcommitisharegit worktree add’s; on error nothing is left behind - add_
or_ plain add_with, orgit worktree addwith the samewt,new_branchandcommitishwhen cloning fails. A failed clone leaves nothing behind, so the plain add starts clean- add_
with addwith your ownOptions- can_
clone - Whether a file in
src_dirclones intodst_dir: both on one volume that supports it. Probed with one small file, since filesystem names miss mount options like XFS without reflink - git
- Runs git in
dirand returns its trimmed stdout - remove_
template - Remove
template, its registration inrepo, and the lock, stamp and staging files next to it. Call it only when noaddorwarmon this template can run: one waiting for the lock would get a deleted file, and the next caller a new one - warm
- Refresh an existing
templatewith the gitignored directories ofsrc, a checkout or a worktree whose work merged. Shares the hidden directories inDEFAULT_SHARE - warm_
with warmwith your ownOptions. It always warms, the interval only applies toadd_with