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;
35pub mod diff_indent_heuristic;
36pub mod diffstat;
37pub mod difftool;
38pub mod dotfile;
39pub mod error;
40mod ewah_bitmap;
41pub mod fast_export;
42pub mod fast_import;
43pub mod fetch_head;
44pub mod fetch_negotiator;
45pub mod fetch_submodules;
46pub mod filter_process;
47pub mod fmt_merge_msg;
48pub mod fsck_standalone;
49pub mod git_binary_base85;
50pub mod git_column;
51pub mod git_date;
52pub mod git_path;
53pub mod gitmodules;
54pub mod hide_refs;
55pub mod hooks;
56pub mod ident;
57pub mod ident_config;
58pub mod ident_resolve;
59pub mod ignore;
60pub mod index;
61pub mod index_name_hash_lazy;
62pub mod interpret_trailers;
63pub mod line_log;
64pub mod ls_remote;
65pub mod mailinfo;
66pub mod mailmap;
67pub mod merge_base;
68pub mod merge_diff;
69pub mod merge_file;
70pub mod merge_tree_trivial;
71pub mod merge_trees;
72pub mod mergetool_vimdiff;
73pub mod midx;
74pub mod name_rev;
75pub mod objects;
76pub mod odb;
77pub mod pack;
78pub mod pack_geometry;
79pub mod pack_name_hash;
80pub mod pack_rev;
81pub mod parse_options_test_tool;
82pub mod patch_ids;
83pub mod path_walk;
84pub mod pathspec;
85pub mod pkt_line;
86pub mod precompose_config;
87pub mod promisor;
88pub mod protocol;
89pub mod prune_packed;
90pub mod push_cert;
91pub mod push_submodules;
92pub mod quote_path;
93pub mod receive_pack;
94pub mod ref_exclusions;
95pub mod ref_namespace;
96pub mod reflog;
97pub mod refs;
98pub mod refs_fsck;
99pub mod reftable;
100pub mod repo;
101pub mod rerere;
102pub mod resolve_undo;
103pub mod rev_list;
104pub mod rev_parse;
105pub mod shallow;
106pub mod shared_repo;
107pub mod signing;
108#[cfg(unix)]
109pub mod simple_ipc;
110pub mod sparse_checkout;
111pub mod split_index;
112pub mod unicode_normalization;
113pub mod untracked_cache;
114pub mod upload_filter;
115#[cfg(not(unix))]
116pub mod simple_ipc {
117    /// Whether simple IPC is supported on this platform.
118    #[must_use]
119    pub fn supports_simple_ipc() -> bool {
120        false
121    }
122
123    /// Stub for non-Unix targets.
124    pub fn run_simple_ipc_tool(_args: &[String]) -> i32 {
125        eprintln!("simple IPC not available on this platform");
126        1
127    }
128}
129pub mod state;
130pub mod stripspace;
131pub mod submodule_active;
132pub mod submodule_config;
133pub mod submodule_config_cache;
134pub mod submodule_gitdir;
135pub mod tab_expand;
136pub mod test_tool_progress;
137pub mod textconv_cache;
138pub mod transport_path;
139pub mod tree_path_follow;
140#[cfg(unix)]
141pub mod unix_process;
142pub mod unpack_objects;
143pub mod url_rewrite;
144pub mod userdiff;
145pub mod whitespace_rule;
146pub mod wildmatch;
147pub mod worktree;
148pub mod worktree_cwd;
149pub mod worktree_ref;
150pub mod write_tree;
151pub mod ws;