Skip to main content

Crate git_lfs_git

Crate git_lfs_git 

Source
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
.gitattributes parsing 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 -z parser.
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* and lfs.prune* config knobs that govern fetch-recent and prune retention. Mirrors upstream’s lfs/config.go::FetchPruneConfig field-for-field so the same defaults apply.
http_options
Read git’s http.<key> and http.<url>.<key> settings.
path
Repository path discovery.
pktline
Git’s packet-line protocol: the framing used by filter-process and 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 --stdin wrapper.
scanner
Scanner: walk git history, find LFS pointer blobs.

Enums§

Error