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.
config
Git-compatible configuration file parser and accessor.
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.
error
Shared error types for the Gust library.
fmt_merge_msg
Merge commit message formatter — git fmt-merge-msg logic.
git_date
Git-compatible date parsing and display (ported from Git date.c).
hooks
Hook execution utilities.
ignore
Ignore and exclude matching for check-ignore.
index
Git index (staging area) reading and writing.
ls_remote
ls-remote — enumerate references from a local repository.
merge_base
Merge-base and reachability primitives.
merge_file
Three-way file merge — the engine behind grit merge-file.
midx
Multi-pack-index (MIDX) file writing.
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.
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.
prune_packed
Library implementation of prune-packed.
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.
rev_list
Commit traversal and output planning for rev-list.
rev_parse
Revision parsing and repository discovery helpers for rev-parse.
state
Repository state machine — HEAD resolution, branch status, and in-progress operation detection.
stripspace
Core logic for git stripspace.
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.
wildmatch
write_tree
Build tree objects from index entries (git write-tree core logic).