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::{validate_ref_name, BranchInfo, BranchType};
17pub use features::commits::CommitInfo;
18pub use features::commits::{check_commit_message, CommitMsgSeverity, COMMIT_SUBJECT_LIMIT};
19pub use features::commits::{CommitAction, CommitActionKind, COMMIT_MENU_GROUPS};
20pub use features::commits::{RefKind, RefLabel};
21pub use features::diff::{
22    blame_file, BlameLine, DiffFileEntry, DiffHunk, DiffInfo, DiffLine, FileStatus,
23    StatusColorCategory,
24};
25pub use features::editor::{open_file_default, show_in_folder, Editor, EDITOR_NAMES};
26pub use features::graph::{GraphEdge, GraphRow};
27pub use features::log::file_history;
28pub use features::persistence::{AppSettings, LayoutSettings, RepoHistoryEntry};
29pub use features::remotes::RemoteInfo;
30pub use features::repo::spawn_git_watcher;
31pub use features::repo::{delete_file, load_repo_snapshot, RepoInfo, RepoSnapshot, RepoState};
32pub use features::stash::StashEntry;
33pub use features::theme::{
34    theme_by_index, theme_index_by_name, AppTheme, Rgb, THEME_COUNT, THEME_NAMES,
35};
36pub use utils::short_oid_str;
37pub use utils::text::{path_basename, truncate_str};
38pub use utils::{
39    ascending_range, clamp_next, clamp_selection, repo_display_name, wrap_next, wrap_prev,
40};