Expand description
Git interop helpers for Git LFS: config, refs, scanners, and .gitattributes matching.
Git LFS needs the user’s git binary for a handful of things
with no LFS-specific equivalent: where the repo lives, what’s
in its config, which objects each ref reaches, and how
.gitattributes applies to a given path. This crate collects
those helpers in one place. Everything runs by shelling out
to the git binary the user has installed; this crate does
not bundle its own git implementation.
It sits at the bottom of the LFS workspace: every other crate goes through it whenever it needs to know something about the repo it’s running against. The crate is intentionally a collection of unrelated helpers rather than a single abstraction, so the pieces are independent of each other and you can pick what you need. See the per-module docs below for the specific surfaces.
Error is the shared error type for the few cases that
need to surface git’s stderr verbatim.
Re-exports§
pub use attr::AttrSet;pub use config::ConfigScope;pub use http_options::HttpOptions;pub use http_options::extra_headers_for;pub use http_options::lfs_url_bool;pub use path::git_common_dir;pub use path::git_dir;pub use path::lfs_alternate_dirs;pub use path::lfs_dir;pub use path::work_tree_root;
Modules§
- aliases
url.<base>.insteadOf <alias>rewrite handling.- attr
.gitattributesparsing and matching.- cat_
file git cat-file --batch[-check]long-running subprocess wrappers.- config
- Get, set, and unset git config values, scoped to one of git’s config files.
- diff_
index git diff-index -zparser.- endpoint
- Resolve the LFS server endpoint for a repo.
- extension
- Pointer extension config (
lfs.extension.<name>.{clean,smudge,priority}). - fetch_
prune - Typed view of the
lfs.fetchrecent*andlfs.prune*config knobs that govern fetch-recent and prune retention. Mirrors upstream’slfs/config.go::FetchPruneConfigfield-for-field so the same defaults apply. - http_
options - Read git’s
http.<key>andhttp.<url>.<key>settings. - path
- Repository path discovery.
- pktline
- Git’s packet-line protocol: the framing used by
filter-processand a handful of other long-running git subprocess interfaces. - refs
- Refspec resolution for the LFS lock APIs and ref enumeration helpers used by fetch-recent and prune retention.
- rev_
list git rev-list --objects --do-walk --stdinwrapper.- scanner
- Scanner: walk git history, find LFS pointer blobs.