Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions src/lib.rs

This file was deleted.

29 changes: 21 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
#![allow(clippy::collapsible_match)]

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},
execute,
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,
Expand Down Expand Up @@ -116,6 +124,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;
Expand Down Expand Up @@ -433,6 +442,7 @@ fn from_args() -> Result<(), String> {
Ok(())
}

/// Run the application
fn run(
mut repository: Option<Repository>,
mut settings: Settings,
Expand Down Expand Up @@ -487,6 +497,7 @@ fn run(
let next_file_update: &Cell<Option<Instant>> = &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;
Expand Down Expand Up @@ -531,6 +542,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))?;
Expand Down Expand Up @@ -974,14 +986,15 @@ pub fn set_model<P: AsRef<Path>>(
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
)
})?;

Ok(())
}

/// Create an App instance, using the provided configuration
fn create_app(
repository: Repository,
settings: &mut Settings,
Expand Down
2 changes: 1 addition & 1 deletion src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn draw_open_repo<B: Backend>(f: &mut Frame<B>, 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.");
Expand Down
3 changes: 3 additions & 0 deletions src/widgets/graph_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GitGraph>,
Expand Down Expand Up @@ -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<Block<'a>>,
Expand Down
Loading