Skip to main content

Crate grit_lib

Crate grit_lib 

Source
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 using thiserror
  • objects — object ID, object kinds, and in-memory representations
  • odb — loose object store (read/write zlib-compressed objects)
  • repo — repository discovery and handle
  • index — Git index (staging area) read/write
  • ignore — ignore/exclude pattern matching for check-ignore
  • refs — reference storage (files backend)

Modules§

attributes
Gitattributes parsing and pattern matching for check-attr and validation.
check_ref_format
Ref-name validation — git check-ref-format rules.
commit_encoding
Git commit encoding labels (encoding header, 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.c and trailer.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-export stream generation.
fast_import
Minimal git fast-import stream support.
fetch_negotiator
Skipping fetch negotiator — mirrors git/negotiator/skipping.c.
filter_process
Long-running Git filter protocol (filter.<name>.process), matching git-filter v2.
fmt_merge_msg
Merge commit message formatter — git fmt-merge-msg logic.
fsck_standalone
Standalone object fsck for hash-object and similar entry points.
git_date
Git-compatible date parsing and display (ported from Git date.c).
gitmodules
.gitmodules validation (Git fsck / submodule-config parity).
hooks
Hook execution utilities.
ident
Git author/committer identity lines (ident in Git’s fsck.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 by test-tool lazy-init-name-hash and 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 .mailmap and 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/vimdiff driver.
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-options surface used by test-tool parse-options and related helpers (parse-options-flags, parse-subcommand). Matches git/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 Repository handle.
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.submodulePathConfig is enabled.
textconv_cache
Git-compatible diff.<driver>.cachetextconv storage under refs/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.whitespace rules and ws_fix_copy (git/ws.c).
wildmatch
Git-compatible wildmatch pattern matching.
write_tree
Build tree objects from index entries (git write-tree core logic).
ws
Git-compatible whitespace rules (core.whitespace, whitespace attribute).