Skip to main content

grit_lib/
lib.rs

1//! Gust library — core Git-compatible engine.
2//!
3//! # Architecture
4//!
5//! All Git-compatible logic lives here; the `grit` binary is a thin CLI shim
6//! that parses arguments and delegates to types exposed from this crate.
7//!
8//! ## Modules
9//!
10//! - [`error`] — shared error types using `thiserror`
11//! - [`objects`] — object ID, object kinds, and in-memory representations
12//! - [`odb`] — loose object store (read/write zlib-compressed objects)
13//! - [`repo`] — repository discovery and handle
14//! - [`index`] — Git index (staging area) read/write
15//! - [`ignore`] — ignore/exclude pattern matching for check-ignore
16//! - [`refs`] — reference storage (files backend)
17
18pub mod attributes;
19pub mod bloom;
20pub mod branch_ref_format;
21pub mod branch_tracking;
22pub mod check_ref_format;
23pub mod combined_diff_patch;
24pub mod combined_tree_diff;
25pub mod commit_encoding;
26pub mod commit_graph_file;
27pub mod commit_graph_write;
28pub mod commit_pretty;
29pub mod commit_trailers;
30pub mod config;
31pub mod connectivity;
32pub mod crlf;
33pub mod delta_encode;
34pub mod diff;
35mod diff_indent_heuristic;
36pub mod diffstat;
37pub mod dotfile;
38pub mod error;
39mod ewah_bitmap;
40pub mod fast_export;
41pub mod fast_import;
42pub mod fetch_head;
43pub mod fetch_negotiator;
44pub mod fetch_submodules;
45pub mod filter_process;
46pub mod fmt_merge_msg;
47pub mod fsck_standalone;
48pub mod git_binary_base85;
49pub mod git_column;
50pub mod git_date;
51pub mod git_path;
52pub mod gitmodules;
53pub mod hide_refs;
54pub mod hooks;
55pub mod ident;
56pub mod ident_config;
57pub mod ident_resolve;
58pub mod ignore;
59pub mod index;
60pub mod index_name_hash_lazy;
61pub mod interpret_trailers;
62pub mod line_log;
63pub mod ls_remote;
64pub mod mailinfo;
65pub mod mailmap;
66pub mod merge_base;
67pub mod merge_diff;
68pub mod merge_file;
69pub mod merge_tree_trivial;
70pub mod merge_trees;
71pub mod mergetool_vimdiff;
72pub mod midx;
73pub mod name_rev;
74pub mod objects;
75pub mod odb;
76pub mod pack;
77pub mod pack_geometry;
78pub mod pack_name_hash;
79pub mod pack_rev;
80pub mod parse_options_test_tool;
81pub mod patch_ids;
82pub mod path_walk;
83pub mod pathspec;
84pub mod pkt_line;
85pub mod precompose_config;
86pub mod promisor;
87pub mod protocol;
88pub mod prune_packed;
89pub mod push_submodules;
90pub mod quote_path;
91pub mod receive_pack;
92pub mod ref_exclusions;
93pub mod ref_namespace;
94pub mod reflog;
95pub mod refs;
96pub mod refs_fsck;
97pub mod reftable;
98pub mod repo;
99pub mod rerere;
100pub mod resolve_undo;
101pub mod rev_list;
102pub mod rev_parse;
103pub mod shallow;
104pub mod shared_repo;
105#[cfg(unix)]
106pub mod simple_ipc;
107pub mod sparse_checkout;
108pub mod split_index;
109pub mod unicode_normalization;
110pub mod untracked_cache;
111#[cfg(not(unix))]
112pub mod simple_ipc {
113    /// Whether simple IPC is supported on this platform.
114    #[must_use]
115    pub fn supports_simple_ipc() -> bool {
116        false
117    }
118
119    /// Stub for non-Unix targets.
120    pub fn run_simple_ipc_tool(_args: &[String]) -> i32 {
121        eprintln!("simple IPC not available on this platform");
122        1
123    }
124}
125pub mod state;
126pub mod stripspace;
127pub mod submodule_active;
128pub mod submodule_config;
129pub mod submodule_config_cache;
130pub mod submodule_gitdir;
131pub mod tab_expand;
132pub mod test_tool_progress;
133pub mod textconv_cache;
134pub mod transport_path;
135pub mod tree_path_follow;
136#[cfg(unix)]
137pub mod unix_process;
138pub mod unpack_objects;
139pub mod url_rewrite;
140pub mod userdiff;
141pub mod whitespace_rule;
142pub mod wildmatch;
143pub mod worktree_cwd;
144pub mod write_tree;
145pub mod ws;