Skip to main content

Module worktree

Module worktree 

Source
Expand description

Throwaway checkouts of historical commits, for tak backfill --commits.

Each commit is built and measured in a detached git worktree under an owner-only temporary directory, never in the user’s own checkout: a build that rewrites target/ or a fixture there would leave the working tree in the state of whatever commit was measured last. Worktrees share the repository’s object store and refs, so a checkout costs only the files it writes, and a note recorded from the main checkout lands on the same refs/notes/tak.

Git is a subprocess here for the same reason it is in crate::notes.

Structs§

FailedCommits
Commits that failed in an earlier run, with how and under what.
Worktree
A detached checkout of one commit, removed when dropped.

Enums§

Failure
How a remembered commit failed.

Functions§

build_finished
The build has been reaped; its group id may be reused from here on.
build_started
The build has been spawned as the leader of process group pid.
clean_up_on_interrupt
Remove this process’s worktrees and scratch when tak is interrupted.
commit_time
When sha was committed, as seconds since the epoch, read from the raw commit object.
fingerprint
A 64-bit FNV-1a hash, as lowercase hex: a stable fingerprint of tak.toml for FailedCommits’s measurement key. Not std’s Hasher, whose output is allowed to change between Rust releases, which would forget every remembered failure on a toolchain upgrade.
prune
Forget worktrees whose directories no longer exist.
stopping
Whether an interrupt is being handled. A build that fails from here on was killed by tak, not broken by its commit.
toplevel
The root of the work tree containing dir.
wait_if_interrupted
Never return once an interrupt has arrived: wait for the cleanup thread to exit the process.