From d8563bf8bcae7fc42e618cc9f42dd9b8ebe48ef6 Mon Sep 17 00:00:00 2001 From: Peer Sommerlund Date: Mon, 18 May 2026 15:32:43 +0200 Subject: [PATCH 1/6] fixup Migrate to gleisbau 0.7.3 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f286dca..dee31dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Upgrade to gleisbau 0.7.3 + ## [0.1.21] - 2026-02-15 From 2bd48a770894f5a8fd75cce39f6fb265b8d61df0 Mon Sep 17 00:00:00 2001 From: Peer Sommerlund Date: Mon, 18 May 2026 15:38:46 +0200 Subject: [PATCH 2/6] Get rid of library leftovers --- src/lib.rs | 6 ------ src/main.rs | 20 +++++++++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 src/lib.rs diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 5539f2f..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub mod app; -pub mod dialogs; -pub mod settings; -pub mod ui; -pub mod util; -pub mod widgets; diff --git a/src/main.rs b/src/main.rs index 85a860d..0e4aa21 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,16 @@ +pub mod app; +pub mod dialogs; +pub mod settings; +pub mod ui; +pub mod util; +pub mod widgets; + +use crate::app::DiffMode; +use crate::settings::AppSettings; +use crate::{ + app::{ActiveView, App, CurrentBranches}, + dialogs::FileDialog, +}; use clap::{crate_version, Arg, Command}; use crossterm::{ event::{self, Event as CEvent, KeyCode, KeyEventKind, KeyModifiers}, @@ -5,13 +18,6 @@ use crossterm::{ terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; use git2::Repository; -use git_igitt::app::DiffMode; -use git_igitt::settings::AppSettings; -use git_igitt::{ - app::{ActiveView, App, CurrentBranches}, - dialogs::FileDialog, - ui, -}; use gleisbau::{ config::{create_config, get_available_models, get_model, get_model_name}, get_repo, From bf88153e71b4f9677073025a17d98c41c0bf9753 Mon Sep 17 00:00:00 2001 From: Peer Sommerlund Date: Tue, 19 May 2026 22:04:10 +0200 Subject: [PATCH 3/6] Comments on items related to GitGraph usage --- src/main.rs | 5 +++++ src/widgets/graph_view.rs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0e4aa21..9f9fb84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -122,6 +122,7 @@ fn setup_logger(log_level: &str) { let _handle = log4rs::init_config(config).unwrap(); } +/// Parse command line arguments, read configuration, and run the application. fn from_args() -> Result<(), String> { let app_dir = AppDirs::new(Some("git-graph"), false).unwrap().config_dir; let mut models_dir = app_dir; @@ -439,6 +440,7 @@ fn from_args() -> Result<(), String> { Ok(()) } +/// Run the application fn run( mut repository: Option, mut settings: Settings, @@ -493,6 +495,7 @@ fn run( let next_file_update: &Cell> = &Cell::new(None); let mut reset_diff_scroll = false; + // Define lambda function "next_event" for reading one event let mut next_event = { let mut sx_old = 0; let mut sy_old = 0; @@ -537,6 +540,7 @@ fn run( let mut last_key = KeyCode::Esc; let mut key_repeat_time = INITIAL_KEY_REPEAT_TIME / 2; + // Event loop loop { app = if let Some(mut app) = app.take() { terminal.draw(|f| ui::draw(f, &mut app))?; @@ -988,6 +992,7 @@ pub fn set_model>( Ok(()) } +/// Create an App instance, using the provided configuration fn create_app( repository: Repository, settings: &mut Settings, diff --git a/src/widgets/graph_view.rs b/src/widgets/graph_view.rs index e5a1ebf..87594fb 100644 --- a/src/widgets/graph_view.rs +++ b/src/widgets/graph_view.rs @@ -12,6 +12,7 @@ use unicode_width::UnicodeWidthStr; const SCROLL_MARGIN: usize = 3; const SCROLLBAR_STR: &str = "\u{2588}"; +/// State used to render widget [GraphView] #[derive(Default)] pub struct GraphViewState { pub graph: Option, @@ -86,6 +87,8 @@ impl GraphViewState { } } +/// Stateful widget for rendering the graph. The state is provided by +/// [GraphViewState] #[derive(Default)] pub struct GraphView<'a> { block: Option>, From ee7cc0d68dd55155c3eba7fb8be873064090fe48 Mon Sep 17 00:00:00 2001 From: Peer Sommerlund Date: Fri, 31 Jul 2026 06:38:59 +0200 Subject: [PATCH 4/6] Make sure to use dependencies that work (close #80) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42c8d09..a7e8dfb 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Decide for yourself which graph is the most comprehensible. :sunglasses: In case you have [Rust](https://www.rust-lang.org/) installed, you can install with `cargo`: ``` -cargo install git-igitt +cargo install --locked git-igitt ``` ## Usage From 1632f43e066fcb04a0b6ff8e1fb8b0cc1ba6d4d8 Mon Sep 17 00:00:00 2001 From: Peer Sommerlund Date: Fri, 31 Jul 2026 22:18:29 +0200 Subject: [PATCH 5/6] Allow clippy collapsible_match --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 9f9fb84..16da176 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +#![allow(clippy::collapsible_match)] + pub mod app; pub mod dialogs; pub mod settings; From 329225ff0f38807df4d6d5407e1206c14af7dddd Mon Sep 17 00:00:00 2001 From: Peer Sommerlund Date: Fri, 31 Jul 2026 22:35:20 +0200 Subject: [PATCH 6/6] Remove redundant & --- src/main.rs | 2 +- src/ui.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 16da176..45b4f7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -986,7 +986,7 @@ pub fn set_model>( std::fs::write(&config_path, str).map_err(|err| { format!( "Can't write repository settings to file {}\n{}", - &config_path.display(), + config_path.display(), err ) })?; diff --git a/src/ui.rs b/src/ui.rs index 125845e..3cb4b70 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -33,7 +33,7 @@ pub fn draw_open_repo(f: &mut Frame, dialog: &mut FileDialog) { let location_block = Block::default().borders(Borders::ALL).title(" Path "); - let paragraph = Paragraph::new(format!("{}", &dialog.location.display())).block(location_block); + let paragraph = Paragraph::new(format!("{}", dialog.location.display())).block(location_block); f.render_widget(paragraph, top_chunks[0]); let help = Paragraph::new(" Navigate with Arrows, confirm with Enter, abort with Esc.");