Expand description
Gust library — core Git-compatible engine.
§Architecture
All Git-compatible logic lives here; the grit binary is a thin CLI shim
that parses arguments and delegates to types exposed from this crate.
§Modules
error— shared error types usingthiserrorobjects— object ID, object kinds, and in-memory representationsodb— loose object store (read/write zlib-compressed objects)repo— repository discovery and handleindex— Git index (staging area) read/writeignore— ignore/exclude pattern matching for check-ignorerefs— reference storage (files backend)
Modules§
- attributes
- Gitattributes parsing and pattern matching for
check-attrand validation. - bloom
- Changed-path Bloom filters for commit-graph files (Git
bloom.ccompatible). - branch_
ref_ format git branch --formatsubset for t3203: atoms and nested-safe%(if)...%(then)...%(else)...%(end).- branch_
tracking - Branch vs remote-tracking comparison for status, checkout, and commit (matches
git/remote.c). - check_
ref_ format - Ref-name validation —
git check-ref-formatrules. - combined_
diff_ patch - Git-style combined merge diff hunks (
diff --cc/diff --combined). - combined_
tree_ diff - Multi-parent combined tree diff (Git
diff_tree_paths/find_paths_multitree). - commit_
encoding - Git commit encoding labels (
encodingheader,i18n.commitEncoding) mapped to codecs. - commit_
graph_ file - Parsing Git commit-graph files and Bloom filter lookup (
commit-graph.c/bloom.ccompatible). - commit_
graph_ write - Serialize Git commit-graph v1 files with GDA2 + optional Bloom chunks (
commit-graph.ccompatible). - commit_
pretty - Human-oriented commit one-line formats shared by porcelain commands.
- commit_
trailers - Cherry-pick / sign-off trailer handling compatible with Git’s
sequencer.candtrailer.c. - config
- Git-compatible configuration file parser and accessor.
- connectivity
- Reachability checks for push / receive-pack connectivity verification.
- crlf
- CRLF / EOL conversion and clean/smudge filter support.
- delta_
encode - Encode Git pack binary deltas (format decoded by
crate::unpack_objects::apply_delta). - diff
- Diff machinery — compare trees, index entries, and working tree files.
- diffstat
- Git-compatible
--stat/ diffstat layout (width, name truncation, bar scaling). - dotfile
- Git-compatible
.git*/ NTFS / HFS path checks (path.c,utf8.c). - error
- Shared error types for the Gust library.
- fast_
export git fast-exportstream generation.- fast_
import - Minimal
git fast-importstream support. - fetch_
head - Parsing
FETCH_HEADlines. - fetch_
negotiator - Skipping fetch negotiator — mirrors
git/negotiator/skipping.c. - fetch_
submodules - Logic for
git fetch --recurse-submodules(changed-submodule detection and config). - filter_
process - Long-running Git filter protocol (
filter.<name>.process), matchinggit-filterv2. - fmt_
merge_ msg - Merge commit message formatter —
git fmt-merge-msglogic. - fsck_
standalone - Standalone object fsck for
hash-objectand similar entry points. - git_
binary_ base85 - Base-85 codec for
GIT binary patchsections (matchesgit/base85.c). - git_
column - Git-compatible column layout for long-format status (untracked / ignored lists).
- git_
date - Git-compatible date parsing and display (ported from Git
date.c). - git_
path - Git-compatible path normalization and helpers for
test-tool path-utils. Logic matchesgit/path.c(normalize_path_copy,longest_ancestor_length,relative_path,strip_path_suffix) andgit/remote.c(relative_url). - gitmodules
.gitmodulesvalidation (Gitfsck/submodule-configparity).- hide_
refs transfer.hideRefs/receive.hideRefs/uploadpack.hideRefsmatching (Gitref_is_hidden).- hooks
- Hook execution utilities.
- ident
- Git author/committer identity lines (
identin Git’sfsck.c/commit.c). - ident_
config - Default identity values from config and the system (Git
ident.c). - ident_
resolve - Git-compatible author/committer identity resolution (see upstream
ident.c). - ignore
- Ignore and exclude matching for
check-ignore. - index
- Git index (staging area) reading and writing.
- index_
name_ hash_ lazy - Lazy, optionally multi-threaded index name/dir hash initialization compatible with Git’s
name-hash.c(used bytest-tool lazy-init-name-hashand regression test t3008). - interpret_
trailers - Commit message trailer parsing and rewriting (Git-compatible).
- line_
log - Line-level history (
git log -L) — range tracking across diffs. - ls_
remote ls-remote— enumerate references from a local repository.- mailinfo
- Email parsing for
mailinfo(aligned with Git’smailinfo.cfort5100-mailinfo). - mailmap
- Parse
.mailmapand resolve author/committer identities (Git-compatible). - merge_
base - Merge-base and reachability primitives.
- merge_
diff - Merge commit and combined (
--cc/-c) diff helpers. - merge_
file - Three-way file merge — the engine behind
grit merge-file. - merge_
tree_ trivial - Trivial three-tree merge for
git merge-tree(no--write-tree). - merge_
trees - Rename-aware three-way tree merge for cherry-pick / revert style merges.
- mergetool_
vimdiff - Vimdiff merge tool layout generation compatible with Git’s
mergetools/vimdiffdriver. - midx
- Multi-pack-index (MIDX) file writing and minimal reading.
- name_
rev - Name-rev: name commits relative to refs.
- objects
- Git object model: object IDs, kinds, and in-memory representations.
- odb
- Loose object database: reading and writing zlib-compressed Git objects.
- pack
- Pack and pack-index helpers for object counting and verification.
- pack_
geometry - Pack geometry for
git repack --geometric(factor-based progression). - pack_
name_ hash - Git pack bitmap name-hash functions (
pack_name_hash/pack_name_hash_v2). - pack_
rev - On-disk pack reverse index (
.rev) — RIDX format matching Git’spack-write.c. - parse_
options_ test_ tool - Git-compatible
parse-optionssurface used bytest-tool parse-optionsand related helpers (parse-options-flags,parse-subcommand). Matchesgit/t/helper/test-parse-options.c. - patch_
ids - Patch-ID computation for commit equivalence detection.
- path_
walk - Path-batched object graph walk matching Git’s
walk_objects_by_path/test-tool path-walk. - pathspec
- Git-compatible pathspec matching (magic tokens and global flags).
- pkt_
line - Git pkt-line format helpers.
- precompose_
config - Read
core.precomposeunicodewithout opening a full [Repository]. - promisor
- Partial-clone promisor bookkeeping used by Grit.
- protocol
- Protocol allow/deny policy.
- prune_
packed - Library implementation of
prune-packed. - push_
submodules - Submodule recursion for
git push(--recurse-submodules). - quote_
path - C-style path quoting compatible with Git’s
quote.c/core.quotepath. - receive_
pack - Receive-pack configuration and pack-header helpers.
- ref_
exclusions - Reference exclusion rules for
rev-list/rev-parse(--exclude,--exclude-hidden). - ref_
namespace - Git
GIT_NAMESPACEhandling: map logical ref names to storage underrefs/namespaces/.../. - reflog
- Reflog reading and management.
- refs
- Reference storage — files backend + reftable backend.
- refs_
fsck - Reference database consistency checks for
git refs verifyandgit fsck --references. - reftable
- Reftable format — binary reference storage.
- repo
- Repository discovery and the primary
Repositoryhandle. - rerere
- Git-compatible rerere (
MERGE_RR,rr-cache/, conflict ID hashing). - resolve_
undo - Git index
REUC(resolve-undo) extension — records unmerged stages when a conflict is resolved. - rev_
list - Commit traversal and output planning for
rev-list. - rev_
parse - Revision parsing and repository discovery helpers for
rev-parse. - shallow
- Shallow repository metadata (
.git/shallow). - shared_
repo - Shared-repository permission helpers (
core.sharedRepository,--shared). - simple_
ipc - Git-compatible “simple IPC” over Unix domain sockets using pkt-line framing.
- sparse_
checkout - Sparse-checkout pattern parsing and path membership (cone and non-cone).
- split_
index - Split index:
linkextension andsharedindex.<sha1>(Gitsplit-index.c). - state
- Repository state machine — HEAD resolution, branch status, and in-progress operation detection.
- stripspace
- Core logic for
git stripspace. - submodule_
active - Submodule “active” state (
submodule.cis_submodule_activeparity). - submodule_
config - Submodule registration and activation (Git
submodule.cparity for tooling). - submodule_
config_ cache - Submodule configuration cache (Git
submodule-config.csubset for test-tool). - submodule_
gitdir - Submodule gitdir paths when
extensions.submodulePathConfigis enabled. - tab_
expand - Expand tab characters in commit log output to spaces, matching Git’s
strbuf_add_tabexpand. - test_
tool_ progress test-tool progress— exercises Git-compatible progress display (t0500).- textconv_
cache - Git-compatible
diff.<driver>.cachetextconvstorage underrefs/notes/textconv/<driver>. - transport_
path - Safety checks for local transport URLs (matches Git
connect.c/path.c). - tree_
path_ follow - Resolve tree paths with symlink following (
get_tree_entry_follow_symlinks). - unicode_
normalization - UTF-8 NFC path normalization for macOS-style filesystems (
core.precomposeUnicode). - unix_
process - Unix-only process helpers (FFI).
- unpack_
objects unpack-objects: unpack a pack stream into loose objects.- untracked_
cache - Git index UNTR (untracked cache) —
git/dir.c/read-cache.c. - url_
rewrite - URL rewrite helpers for
url.*.insteadOf/url.*.pushInsteadOf. - userdiff
- User-defined and built-in diff function-name matching.
- whitespace_
rule - Git-compatible
core.whitespacerules andws_fix_copy(git/ws.c). - wildmatch
- Git-compatible wildmatch pattern matching.
- worktree_
cwd - Process current working directory relative to a Git work tree.
- write_
tree - Build tree objects from index entries (
git write-treecore logic). - ws
- Git-compatible whitespace rules (
core.whitespace,whitespaceattribute).