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. - check_
ref_ format - Ref-name validation —
git check-ref-formatrules. - commit_
encoding - Git commit encoding labels (
encodingheader,i18n.commitEncoding) mapped to codecs. - 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). - error
- Shared error types for the Gust library.
- fast_
export git fast-exportstream generation.- fast_
import - Minimal
git fast-importstream support. - fetch_
negotiator - Skipping fetch negotiator — mirrors
git/negotiator/skipping.c. - 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_
date - Git-compatible date parsing and display (ported from Git
date.c). - gitmodules
.gitmodulesvalidation (Gitfsck/submodule-configparity).- hooks
- Hook execution utilities.
- ident
- Git author/committer identity lines (
identin Git’sfsck.c/commit.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.- 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_
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). - 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.
- pathspec
- Git-compatible pathspec matching (magic tokens and global flags).
- promisor
- Partial-clone promisor bookkeeping used by Grit.
- prune_
packed - Library implementation of
prune-packed. - quote_
path - C-style path quoting compatible with Git’s
quote.c/core.quotepath. - reflog
- Reflog reading and management.
- refs
- Reference storage — files backend + reftable backend.
- reftable
- Reftable format — binary reference storage.
- repo
- Repository discovery and the primary
Repositoryhandle. - rerere
- Git-compatible rerere (
MERGE_RR,rr-cache/, conflict ID hashing). - rev_
list - Commit traversal and output planning for
rev-list. - rev_
parse - Revision parsing and repository discovery helpers for
rev-parse. - 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).
- state
- Repository state machine — HEAD resolution, branch status, and in-progress operation detection.
- stripspace
- Core logic for
git stripspace. - submodule_
gitdir - Submodule gitdir paths when
extensions.submodulePathConfigis enabled. - textconv_
cache - Git-compatible
diff.<driver>.cachetextconvstorage underrefs/notes/textconv/<driver>. - tree_
path_ follow - Resolve tree paths with symlink following (
get_tree_entry_follow_symlinks). - unix_
process - Unix-only process helpers (FFI).
- unpack_
objects unpack-objects: unpack a pack stream into loose objects.- 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.
- write_
tree - Build tree objects from index entries (
git write-treecore logic). - ws
- Git-compatible whitespace rules (
core.whitespace,whitespaceattribute).