Expand description
What git says about the state of a work tree and of every branch: uncommitted work from
status --porcelain, and every local branch with its upstream, its distance from it and
the work tree holding it from one for-each-ref. Nothing here fetches.
Structs§
- Branch
Ref - One local branch as
for-each-refreports it.
Functions§
- aged_
dirty_ state - Uncommitted work in a work tree, counted as
dirty_statecounts it, with the moment of its oldest change: the earliest modification time among the pathsgit statusnames. A changed path that no longer exists on disk — a deletion — has no time of its own, and the index file’s modification time stands in for it, as it does for a work tree whose paths cannot be read at all.Noneonly when neither can be read. - branch
- One local branch, read now: the same fields as
branches, for a caller that must not act on a reading taken earlier.Nonewhen the branch no longer exists. - branches
- Every local branch, in one subprocess: name, commit, upstream with its ahead/behind distance, and the work tree holding it.
- dirty_
state - Count the entries of
git status --porcelain -zfor a work tree. Untracked files are counted as files (--untracked-files=all), because a directory of untracked work is the thing a move must not lose and “1 untracked” for a directory of forty files would understate it. - dirty_
states - The dirty state of many work trees, measured at once.
- gitdir_
link - The path a linked work tree’s
.gitfile names, when it names one. Git writes exactly one line,gitdir: <path>, and the path is normally absolute. - issue_
ids - The issue ids this repository’s project model declares: the file names under
.ai/repo/project/issues/, read from the primary checkout. A filesystem read, not an index build, so the topology stays cheap. - issue_
of - The issue a branch provably names: a path component equal to an issue id, or beginning
with the id followed by
-. Nothing else counts. - merged_
into - Every local branch reachable from
trunk, in one subprocess. - merged_
into_ trunk - Every local branch reachable from
trunkor from the remote-tracking branchtrunkfollows. A local trunk that has fallen behind its remote — a primary checkout nobody has pulled, because a session holds uncommitted work in it — would otherwise call every branch that landed since unmerged, and cleanup would offer nothing; a branch the remote trunk contains is published and integrated, which is the safety cleanup asks for. - operation_
in_ progress - The operation git is in the middle of in this work tree, if any: what
git statuswould report as “rebase in progress” and so on, read from the per-worktree git directory the way git itself does. - parse_
branches - Parse the format above: five NUL-terminated fields per branch, one branch per line.
- parse_
status_ z - Parse the NUL-separated porcelain v1 status. Renames are disabled by the caller
(
--no-renames), so every entry isXY path\0and no entry is followed by a second path. - processes_
inside - Which of these directories has a process working inside it right now, one answer per directory in the order given.