Expand description
GitBackend implementation driving an installed system git binary.
Used both standalone (user-selectable default_backend = "system") and
as the CLI-fallback target inside Git2Backend for operations git2
doesn’t support well. Parses only machine-readable git output
(--porcelain=v2 -z, NUL-delimited log formats) – never human text.
Structs§
- Command
Output - How a finished program ended.
- Config
Entry - One value of a multi-valued config key, in the order git read it.
- System
GitBackend
Enums§
- Command
RunError - Why a program gave no output at all.
- Credential
Mode - How network commands get HTTPS credentials; the daemon sets it from
credentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. How network commands get HTTPS credentials (credentials.https_mode). Process-wide because the daemon owns the process and re-reads the setting before each network operation.
Constants§
Functions§
- apply_
tag_ sync - Fills in every tag’s
tag_syncand appends one remote-only row per mirrored tag name that has norefs/tags/<name>here. - body_of
rawas aBlobBody: an LFS pointer is resolved to its local object (shared with the git2 backend so both answer alike).- check_
config_ section - The config-section rules of the undo journal, shared with
Git2Backendso the two accept exactly the same sections. The config-section rules of the undo journal, shared withGit2Backendso the two accept exactly the same sections. The config-section rules of the undo journal, shared withGit2Backendso the two accept exactly the same sections.branch.<name>andremote.<name>only: this is an undo helper, not a config API. - config_
entries - Every entry whose key matches
pattern(a regexp, as--get-regexptakes it), in config order.Errwhen git cannot be asked; no match is an empty list. - config_
key_ in_ section - The config-section rules of the undo journal, shared with
Git2Backendso the two accept exactly the same sections. The config-section rules of the undo journal, shared withGit2Backendso the two accept exactly the same sections. The config-section rules of the undo journal, shared withGit2Backendso the two accept exactly the same sections. Whetherkeyis a variable ofsection(branch.aownsbranch.a.remotebut notbranch.a.b.remote, which is brancha.b’s). - credential_
helper_ entries - Every
credential.helperandcredential.<url>.helperentry. - credential_
mode - How network commands get HTTPS credentials; the daemon sets it from
credentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. - document_
from_ stages - The part of
merge_documentafter the stages are read, and the label reader, shared withGit2Backend(which reads the stages natively). The part ofmerge_documentafter the stages are read, and the label reader, shared withGit2Backend(which reads the stages natively). The part ofmerge_documentafter the stages are read, and the label reader, shared withGit2Backend(which reads the stages natively). Everything after the stages are read, shared withGit2Backend(which reads them natively): runs git’s 3-way merge on them, reads the labels and the file on disk, and assembles the document. - expand_
home - How network commands get HTTPS credentials; the daemon sets it from
credentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation.~/xas the user’s home plusx(ssh would, but the shell git runs the command in does not expand a quoted tilde). - git_dir
- The part of
merge_documentafter the stages are read, and the label reader, shared withGit2Backend(which reads the stages natively). The part ofmerge_documentafter the stages are read, and the label reader, shared withGit2Backend(which reads the stages natively). The part ofmerge_documentafter the stages are read, and the label reader, shared withGit2Backend(which reads the stages natively). The git directory of the worktree atroot:.gititself, or what a linked worktree’s (or submodule’s).gitfile points at. - git_
program - How network commands get HTTPS credentials; the daemon sets it from
credentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. Thegitexecutable every spawn uses, resolved once per process. - global_
ssh_ key_ command - How network commands get HTTPS credentials; the daemon sets it from
credentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. TheGIT_SSH_COMMANDa network command needs to use the configured key, orNonewhen it must be left alone. Precedence, highest first - the configured key only fills a gap, it never overrides: - global_
ssh_ program - The program word of the effective global
core.sshCommand(system or global scope; the repository’s own is what the profile overrides), orssh. Users often point it at the Windows OpenSSH client to reach the Windows agent, so a key file must be offered through the same program. - is_
config_ key_ section - The config-section rules of the undo journal, shared with
Git2Backendso the two accept exactly the same sections. The config-section rules of the undo journal, shared withGit2Backendso the two accept exactly the same sections. The config-section rules of the undo journal, shared withGit2Backendso the two accept exactly the same sections.sectionis one allow-listed key standing for itself (seecheck_section). - lfs_
local_ object - The real content of an LFS object when it sits in the local store
(
<storage>/objects/aa/bb/<oid>,lfs.storagehonoured) and is withinmaxbytes. Costs onegit rev-parseand onegit configspawn. - machine_
wide_ helpers - The helpers that remain once the repository’s own are dropped: the system
and global entries, in order, as
(None, helper)forcredential.helperand(Some(url), helper)forcredential.<url>.helper. An empty value is git’s reset: it clears what was collected before it for the same scope of URLs, as git itself would. - prune_
empty_ parents - After
removedfiles (paths relative toroot) were deleted from disk, removes each directory that is now completely empty, walking up from every file’s parent and stopping at the first directory that is not. - reflog_
via_ git - The reflog through
git log -g, for ref storage with no log files (reftable).oldis the next older entry’snew(the first entry’s isZERO_OID), so one extra entry is read to give the last one of the page itsoldand to know whether there ismore. A ref without a reflog (a deleted branch, a tag, an unknown name) is an empty page. - remote_
dependents_ in - The config-section rules of the undo journal, shared with
Git2Backendso the two accept exactly the same sections. The config-section rules of the undo journal, shared withGit2Backendso the two accept exactly the same sections. The config-section rules of the undo journal, shared withGit2Backendso the two accept exactly the same sections. [remote_dependents] over already-read config entries (git2 shares it). - remove_
stale_ transfer_ files - Which remotes are known to hold a tag at a given commit, given the remote-tag mirror.
- run_
command - Runs
argv(program first) incwd, waits at mosttimeout. On a timeout the whole process tree is killed at once (SIGKILL to its group, or the Windows Job Object terminated), not asked politely. - set_
credential_ mode - How network commands get HTTPS credentials; the daemon sets it from
credentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. Sets the mode every later network command uses. - set_
ssh_ key - How network commands get HTTPS credentials; the daemon sets it from
credentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. How network commands get HTTPS credentials; the daemon sets it fromcredentials.https_modebefore each network operation. Sets the key file every later network command offers to ssh (None: leave ssh to the agent and its own configuration). Seessh_key_command. - snapshot_
normalize_ all - snapshot_
remove_ any - Removes whatever is at
full(file, symlink or directory), if anything. - snapshot_
walk - Every file (and, on Unix, symlink) at or under each of
pathsin the working tree, by repo-relative path..gitis never entered. - snapshot_
write_ file - ssh_
command_ entries - Every
core.sshCommandentry. - tag_
sync_ for - Which remotes hold
name, split by whether they hold it at this commit;localsays whether the tag exists here at all. - total_
spawn_ count - Process-wide spawn counter (see
process), the perf guard’s currency. How manygitcommands the whole process has built so far, on any thread. Unlike the per-thread count it sees the daemon’s worker threads, so the daemon tests andxtask perfuse it; callers that share a process with other git users must serialise themselves to diff it.