Documentation
¶
Overview ¶
Package worktree gives work its own git worktree, so it can change files without touching the checkout the user works in (spec_027_parity §8.2): <repo>/.blitz/worktrees/<name> on the branch blitz/<name>, from HEAD or another ref, with the untracked files .worktreeinclude lists (a .env, say) copied in.
Index ¶
Constants ¶
const BranchPrefix = "blitz/"
BranchPrefix names their branches.
const Dir = ".blitz/worktrees"
Dir is where worktrees go, under the repository's root.
const IncludeFile = ".worktreeinclude"
IncludeFile lists, one pattern a line, untracked files to copy into a new worktree.
Variables ¶
var ErrNotRepo = errors.New("not in a git repository")
ErrNotRepo means the directory isn't in a git repository.
Functions ¶
func Dirty ¶
Dirty reports whether w has changes to tracked files not committed (untracked files, such as those copied in, don't count).
Types ¶
type Worktree ¶
type Worktree struct {
Name string
Path string
Branch string
// Missing means git knows it, but its directory is gone (prune removes
// it).
Missing bool
}
Worktree is one of Blitz's worktrees.
func Create ¶
Create makes the worktree name (a new name when "") in the repository dir is in, on a new branch blitz/<name> from ref (HEAD when ""), and copies in the files .worktreeinclude lists.