Skip to main content

Crate git_cow

Crate git_cow 

Source
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

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 wt by cloning template, refreshed to template_start and warmed from repo first. new_branch and commitish are git worktree add’s; on error nothing is left behind
add_with
add with your own Options
can_clone
Whether a file in src_dir clones into dst_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 dir and returns its trimmed stdout
warm
Refresh an existing template with the gitignored directories of src, a checkout or a worktree whose work merged. Shares the hidden directories in DEFAULT_SHARE
warm_with
warm with your own Options. It always warms, the interval only applies to add_with