Skip to main content

gitkraft_core/
lib.rs

1//! GitKraft Core
2//!
3//! Shared, framework-free logic reused by both the Iced GUI and Ratatui TUI.
4//!
5//! | Module | What lives here |
6//! |--------|-----------------|
7//! | [`features`] | Git operations and types grouped by feature — repo, branches, commits, diff, staging, remotes, stash, log |
8//! | [`utils`] | Helpers — relative time formatting, OID formatting, text truncation |
9//!
10//! This crate has NO GUI or TUI dependencies.
11
12pub mod features;
13pub mod utils;
14
15// Convenience re-exports
16pub use features::branches::{BranchInfo, BranchType};
17pub use features::commits::CommitInfo;
18pub use features::commits::{CommitAction, CommitActionKind, COMMIT_MENU_GROUPS};
19pub use features::commits::{RefKind, RefLabel};
20pub use features::diff::{
21    blame_file, BlameLine, DiffFileEntry, DiffHunk, DiffInfo, DiffLine, FileStatus,
22    StatusColorCategory,
23};
24pub use features::editor::{open_file_default, show_in_folder, Editor, EDITOR_NAMES};
25pub use features::graph::{GraphEdge, GraphRow};
26pub use features::log::file_history;
27pub use features::persistence::{AppSettings, LayoutSettings, RepoHistoryEntry};
28pub use features::remotes::RemoteInfo;
29pub use features::repo::spawn_git_watcher;
30pub use features::repo::{delete_file, load_repo_snapshot, RepoInfo, RepoSnapshot, RepoState};
31pub use features::stash::StashEntry;
32pub use features::theme::{
33    theme_by_index, theme_index_by_name, AppTheme, Rgb, THEME_COUNT, THEME_NAMES,
34};
35pub use utils::short_oid_str;
36pub use utils::text::{path_basename, truncate_str};
37pub use utils::{
38    ascending_range, clamp_next, clamp_selection, repo_display_name, wrap_next, wrap_prev,
39};