Expand description
Pure parsers for git’s output. No IO, no terminal.
Structs§
- Branch
- Commit
- Entry
x/yare git’s XY codes (.= unchanged). Untracked is?/?.- LogRow
- One output line of
git log --graph: a commit, or a graph-only connector line. - Progress
- RefUpdate
- Splitter
- Streaming splitter: yields a line on
\ror\n(a\r\npair yields one line), even when a line spans several chunks. Bytes are decoded as lossy UTF-8. - Stash
- Status
- Parsed
git status --porcelain=v2 --branch -z. - Submodule
State
Enums§
- Event
- One classified line of git output.
- Pull
Line - One classified stdout line. Each variant holds enough to rebuild the line exactly.
- Pull
Result - RefKind
Constants§
- BRANCH_
FORMAT - Format for
git for-each-ref refs/headsparsed byparse_branches. - LOG_
FORMAT - Format string for
git log --graph: graph prefix, then US-separated fields. - STASH_
FORMAT - Format for
git stash listparsed byparse_stash_list. - US
- Field separator used in the formats below (
%x1f/%1f).
Functions§
- classify
- Classify one line from git’s stderr.
- classify_
pull_ line - is_
pack_ stats - Pack statistics line (
Total 11 (delta 10), reused ...), local orremote:. Not progress and not a server message: callers drop it. - parse_
branches - parse_
fetch_ porcelain git fetch --porcelainstdout:<flag> <old> <new> <ref>.- parse_
graph_ line - parse_
human_ ref_ line - Human ref line from pull/clone/fetch stderr (C locale):
old..new src -> dst,* [new branch] src -> dst,+ a...b src -> dst (forced update). - parse_
name_ status_ z git diff/show --name-status -z:(code, path, orig); renames/copies carry the source path.- parse_
numstat_ z git diff [--cached] --numstat -z:added\tdeleted\tpath\0, renames asadded\tdeleted\t\0src\0dst\0.- parse_
push_ porcelain git push --porcelainstdout:To <url>,<flag>\t<src>:<dst>\t<summary>,Done.- parse_
shortlog git shortlog -sne:(count, "Name <email>"), most commits first (git’s order).- parse_
stash_ list - parse_
status_ v2 - parse_
submodule_ status git submodule status:[ +-U]<sha> <path>[ (<describe>)]-> path to checked-out sha. Uninitialized (-) submodules have no checkout and are left out.
Type Aliases§
- Numstat
- Per-file line counts keyed by repo-relative path;
Nonemeans binary.