Expand description
Pure git plumbing shared across feature modules (sdd change binding, tool agents-md, skills config discovery, prompts paths).
Function bodies are moved verbatim from their original homes
(sdd::change::git_native, skills::shared::git) so error messages stay
byte-identical. Sdd-specific binding semantics (ChangeGitBinding,
read/write_binding, start/attach/checkpoint flows) remain in
sdd::change::git_native.
This module is a member of the top-level utility layer (future
llman-core); it MUST NOT import feature modules (sdd/skills/tool/x).
Functions§
- branch_
diff - branch_
has_ upstream - current_
branch - current_
head_ sha - effective_
range_ base - Effective diff-range base (git-native-v2 D1): the live merge-base of the local default branch with HEAD, the single entry point for all range semantics (locked-rule gate, specs landing, change diff/commit count, staleness). Computing it on demand means the range always covers exactly the branch’s own work and shrinks automatically after merge/rebase — no stored state, immune to unpushed accumulation. Fails when git is unavailable or no default ref exists; callers fall back to the stored base_sha (fail-open, same as the pre-v2 behavior).
- find_
git_ root - Walk up from
startlooking for a.gitentry (dir or worktree file). - git_
common_ dir - Resolve the absolute
.gitdirectory path. - git_
ref_ exists - is_
default_ branch - merge_
base_ sha - resolve_
default_ branch_ ref - Resolve the default branch ref, local-first (git-native-v2 D1): local
main→ localmaster→origin/HEADtarget →origin/main→origin/master. The local ref is the anchor for all range semantics so long-lived local work without push never drifts the base (the previous origin-first order left every change’s base at the last push position). - run_git
- working_
tree_ clean - worktree_
add git worktree add <path> -b <branch> <base_sha>(creates and checks out).- worktree_
exists - Check if a directory is already a git worktree.