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 with cp -c (clonefile), Linux with cp --reflink=always (FICLONE)

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
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