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