repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/compare_commits.rs
src/popups/compare_commits.rs
use crate::components::{ command_pump, event_pump, visibility_blocking, CommandBlocking, CommandInfo, CommitDetailsComponent, Component, DiffComponent, DrawableComponent, EventState, }; use crate::{ accessors, app::Environment, keys::{key_match, SharedKeyConfig}, options::SharedOptions, popups::InspectCommitOpe...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/inspect_commit.rs
src/popups/inspect_commit.rs
use crate::components::{ command_pump, event_pump, visibility_blocking, CommandBlocking, CommandInfo, CommitDetailsComponent, Component, DiffComponent, DrawableComponent, EventState, }; use crate::{ accessors, app::Environment, keys::{key_match, SharedKeyConfig}, options::SharedOptions, queue::{InternalEvent, Q...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/stashmsg.rs
src/popups/stashmsg.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, InputType, TextInputComponent, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::{AppTabs, InternalEvent, Queue}, strings, tabs::StashingOptions, }; use anyhow::Result;...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/create_branch.rs
src/popups/create_branch.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, InputType, TextInputComponent, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, NeedsUpdate, Queue}, strings, ui::style::SharedTheme, }; use anyhow::Re...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/commit.rs
src/popups/commit.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, TextInputComponent, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, options::SharedOptions, queue::{InternalEvent, NeedsUpdate, Queue}, strings, try_or_popup, ui::style::Sh...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/pull.rs
src/popups/pull.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, CredComponent, DrawableComponent, EventState, }, keys::SharedKeyConfig, popups::PushPopup, queue::{Action, InternalEvent, Queue}, strings, try_or_popup, ui::{self, style::SharedTheme}, }; use anyhow::R...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/fetch.rs
src/popups/fetch.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, CredComponent, DrawableComponent, EventState, }, keys::SharedKeyConfig, queue::{InternalEvent, NeedsUpdate, Queue}, strings, ui::{self, style::SharedTheme}, }; use anyhow::Result; use asyncgit::{ async...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/revision_files.rs
src/popups/revision_files.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, RevisionFilesComponent, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, Queue, StackablePopupOpen}, strings::{self}, AsyncNotification, }; use anyhow:...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/file_revlog.rs
src/popups/file_revlog.rs
use crate::{ app::Environment, components::{ event_pump, visibility_blocking, CommandBlocking, CommandInfo, Component, DiffComponent, DrawableComponent, EventState, ItemBatch, ScrollType, }, keys::{key_match, SharedKeyConfig}, options::SharedOptions, queue::{InternalEvent, NeedsUpdate, Queue, StackablePopup...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/options.rs
src/popups/options.rs
use crate::{ app::Environment, components::{ string_width_align, visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }, keys::{key_match, SharedKeyConfig}, options::SharedOptions, queue::{InternalEvent, Queue}, strings, ui::{self, style::SharedTheme}, }; use anyhow::...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/mod.rs
src/popups/mod.rs
mod blame_file; mod branchlist; mod checkout_option; mod commit; mod compare_commits; mod confirm; mod create_branch; mod create_remote; mod externaleditor; mod fetch; mod file_revlog; mod fuzzy_find; mod goto_line; mod help; mod inspect_commit; mod log_search; mod msg; mod options; mod pull; mod push; mod push_tags; m...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/remotelist.rs
src/popups/remotelist.rs
use std::cell::Cell; use asyncgit::sync::{get_remote_url, get_remotes, RepoPathRef}; use ratatui::{ layout::{ Alignment, Constraint, Direction, Layout, Margin, Rect, }, text::{Line, Span, Text}, widgets::{Block, BorderType, Borders, Clear, Paragraph, Wrap}, Frame, }; use unicode_truncate::UnicodeTruncateStr; u...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/goto_line.rs
src/popups/goto_line.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, Queue}, strings, ui::{self, style::SharedTheme}, }; use ratatui::{ layout::Rect, style::{Color, Style}, w...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/msg.rs
src/popups/msg.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, ScrollType, VerticalScroll, }; use crate::strings::order; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, strings, ui, }; use anyhow::Result; use crossterm::event::Event; use rat...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/submodules.rs
src/popups/submodules.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, ScrollType, VerticalScroll, }, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, NeedsUpdate, Queue}, strings, try_or_popup, ui::{self, Size}, }; use anyhow::Resu...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/checkout_option.rs
src/popups/checkout_option.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }; use crate::queue::{InternalEvent, NeedsUpdate}; use crate::strings::CheckoutOptions; use crate::try_or_popup; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::Queue, st...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/reset.rs
src/popups/reset.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::Queue, strings, try_or_popup, ui::{self, style::SharedTheme}, }; use anyhow::Result; use asyncgit::{ cached, sync::{...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/confirm.rs
src/popups/confirm.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }, keys::{key_match, SharedKeyConfig}, queue::{Action, InternalEvent, Queue}, strings, ui, }; use anyhow::Result; use crossterm::event::Event; use ratatui::{layout::Rect, t...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/log_search.rs
src/popups/log_search.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, InputType, TextInputComponent, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, Queue}, strings::{self, POPUP_COMMIT_SHA_INVALID}, ui::{self, style::Sh...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/tag_commit.rs
src/popups/tag_commit.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, InputType, TextInputComponent, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, NeedsUpdate, Queue}, strings, try_or_popup, }; use anyhow::Result; use a...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/keys/symbols.rs
src/keys/symbols.rs
use std::{fs::File, io::Read, path::PathBuf}; use anyhow::Result; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone)] pub struct KeySymbols { pub enter: String, pub left: String, pub right: String, pub up: String, pub down: String, pub backspace: String, pub home: String, pub end: String, pub page_u...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/keys/mod.rs
src/keys/mod.rs
mod key_config; mod key_list; mod symbols; pub use key_config::{KeyConfig, SharedKeyConfig}; pub use key_list::key_match;
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/keys/key_config.rs
src/keys/key_config.rs
use anyhow::Result; use crossterm::event::{KeyCode, KeyModifiers}; use std::{fs::canonicalize, path::PathBuf, rc::Rc}; use crate::{args::get_app_config_path, strings::symbol}; use super::{ key_list::{GituiKeyEvent, KeysList}, symbols::KeySymbols, }; pub type SharedKeyConfig = Rc<KeyConfig>; const KEY_LIST_FILENAME...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/keys/key_list.rs
src/keys/key_list.rs
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use serde::{Deserialize, Serialize}; use std::{fs::File, path::PathBuf}; use struct_patch::traits::Patch as PatchTrait; use struct_patch::Patch; #[derive(Debug, PartialOrd, Clone, Copy, Serialize, Deserialize)] pub struct GituiKeyEvent { pub code: KeyCode, pub...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/ui/syntax_text.rs
src/ui/syntax_text.rs
use asyncgit::{ asyncjob::{AsyncJob, RunParams}, ProgressPercent, }; use once_cell::sync::{Lazy, OnceCell}; use ratatui::text::{Line, Span}; use scopetime::scope_time; use std::{ ops::Range, path::{Path, PathBuf}, sync::{Arc, Mutex}, time::{Duration, Instant}, }; use syntect::{ highlighting::{ FontStyle, Highl...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/ui/stateful_paragraph.rs
src/ui/stateful_paragraph.rs
use easy_cast::Cast; use ratatui::{ buffer::Buffer, layout::{Alignment, Position, Rect}, style::Style, text::{StyledGrapheme, Text}, widgets::{Block, StatefulWidget, Widget, Wrap}, }; use std::iter; use unicode_width::UnicodeWidthStr; use super::reflow::{LineComposer, LineTruncator, WordWrapper}; const fn get_li...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/ui/scrolllist.rs
src/ui/scrolllist.rs
use super::style::SharedTheme; use ratatui::{ buffer::Buffer, layout::Rect, style::Style, text::{Span, Text}, widgets::{Block, Borders, List, ListItem, Widget}, Frame, }; /// struct ScrollableList<'b, L, S> where S: Into<Text<'b>>, L: Iterator<Item = S>, { block: Option<Block<'b>>, /// Items to be displayed ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/ui/reflow.rs
src/ui/reflow.rs
use crate::string_utils::trim_offset; use easy_cast::Cast; use ratatui::text::StyledGrapheme; use unicode_width::UnicodeWidthStr; const NBSP: &str = "\u{00a0}"; /// A state machine to pack styled symbols into lines. /// Cannot implement it as Iterator since it yields slices of the internal buffer (need streaming /// ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/ui/mod.rs
src/ui/mod.rs
mod reflow; mod scrollbar; mod scrolllist; mod stateful_paragraph; pub mod style; mod syntax_text; use filetreelist::MoveSelection; use ratatui::layout::{Constraint, Direction, Layout, Rect}; pub use scrollbar::{draw_scrollbar, Orientation}; pub use scrolllist::{draw_list, draw_list_block}; pub use stateful_paragraph:...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/ui/style.rs
src/ui/style.rs
use crate::ui::syntax_text::DEFAULT_SYNTAX_THEME; use anyhow::Result; use asyncgit::{DiffLineType, StatusItemType}; use ratatui::style::{Color, Modifier, Style}; use ron::ser::{to_string_pretty, PrettyConfig}; use serde::{Deserialize, Serialize}; use std::{fs::File, io::Write, path::PathBuf, rc::Rc}; use struct_patch::...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/ui/scrollbar.rs
src/ui/scrollbar.rs
use super::style::SharedTheme; use easy_cast::CastFloat; use ratatui::{ buffer::Buffer, layout::{Margin, Rect}, style::Style, symbols::{ block::FULL, line::{DOUBLE_HORIZONTAL, DOUBLE_VERTICAL}, }, widgets::Widget, Frame, }; pub enum Orientation { Vertical, Horizontal, } /// struct Scrollbar { max: u16, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/invalidstring/src/lib.rs
invalidstring/src/lib.rs
#![deny(mismatched_lifetime_syntaxes)] /// uses unsafe to postfix the string with invalid utf8 data #[allow(invalid_from_utf8_unchecked)] pub fn invalid_utf8(prefix: &str) -> String { let bytes = b"\xc3\x73"; unsafe { format!("{prefix}{}", std::str::from_utf8_unchecked(bytes)) } }
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/fetch_job.rs
asyncgit/src/fetch_job.rs
//! use crate::{ asyncjob::{AsyncJob, RunParams}, error::Result, sync::remotes::fetch_all, sync::{cred::BasicAuthCredential, RepoPath}, AsyncGitNotification, ProgressPercent, }; use std::sync::{Arc, Mutex}; enum JobState { Request(Option<BasicAuthCredential>), Response(Result<()>), } /// #[derive(Clone)] pub...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/blame.rs
asyncgit/src/blame.rs
use crate::{ error::Result, hash, sync::{self, CommitId, FileBlame, RepoPath}, AsyncGitNotification, }; use crossbeam_channel::Sender; use std::{ hash::Hash, sync::{ atomic::{AtomicUsize, Ordering}, Arc, Mutex, }, }; /// #[derive(Hash, Clone, PartialEq, Eq)] pub struct BlameParams { /// path to the file to...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/lib.rs
asyncgit/src/lib.rs
/*! `AsyncGit` is a library that provides non-blocking access to Git operations, enabling `GitUI` to perform potentially slow Git operations in the background while keeping the user interface responsive. It also provides synchronous Git operations. It wraps libraries like git2 and gix. */ #![forbid(missing_docs)] #!...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/push.rs
asyncgit/src/push.rs
use crate::{ error::{Error, Result}, sync::{ cred::BasicAuthCredential, remotes::push::push_raw, remotes::push::{ProgressNotification, PushType}, RepoPath, }, AsyncGitNotification, RemoteProgress, }; use crossbeam_channel::{unbounded, Sender}; use std::{ sync::{Arc, Mutex}, thread, }; /// #[derive(Defaul...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/remote_progress.rs
asyncgit/src/remote_progress.rs
//! use crate::{ error::Result, progress::ProgressPercent, sync::remotes::push::{AsyncProgress, ProgressNotification}, AsyncGitNotification, }; use crossbeam_channel::{Receiver, Sender}; use git2::PackBuilderStage; use std::{ sync::{Arc, Mutex}, thread::{self, JoinHandle}, }; /// used for push/pull #[derive(Clo...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/diff.rs
asyncgit/src/diff.rs
use crate::{ error::Result, hash, sync::{ self, commit_files::OldNew, diff::DiffOptions, CommitId, RepoPath, }, AsyncGitNotification, FileDiff, }; use crossbeam_channel::Sender; use std::{ hash::Hash, sync::{ atomic::{AtomicUsize, Ordering}, Arc, Mutex, }, }; /// #[derive(Debug, Hash, Clone, PartialEq,...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/commit_files.rs
asyncgit/src/commit_files.rs
use crate::{ error::Result, sync::{self, commit_files::OldNew, CommitId, RepoPath}, AsyncGitNotification, StatusItem, }; use crossbeam_channel::Sender; use std::sync::{ atomic::{AtomicUsize, Ordering}, Arc, Mutex, }; type ResultType = Vec<StatusItem>; struct Request<R, A>(R, A); /// #[derive(Debug, Copy, Clone, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/status.rs
asyncgit/src/status.rs
use crate::{ error::Result, hash, sync::{ self, status::StatusType, RepoPath, ShowUntrackedFilesConfig, }, AsyncGitNotification, StatusItem, }; use crossbeam_channel::Sender; use std::{ hash::Hash, sync::{ atomic::{AtomicUsize, Ordering}, Arc, Mutex, }, time::{SystemTime, UNIX_EPOCH}, }; fn current_tick...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/push_tags.rs
asyncgit/src/push_tags.rs
use crate::{ error::{Error, Result}, sync::{ cred::BasicAuthCredential, remotes::tags::{push_tags, PushTagsProgress}, RepoPath, }, AsyncGitNotification, RemoteProgress, }; use crossbeam_channel::{unbounded, Sender}; use std::{ sync::{Arc, Mutex}, thread, }; /// #[derive(Default, Clone, Debug)] pub struct P...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/filter_commits.rs
asyncgit/src/filter_commits.rs
use rayon::{ prelude::ParallelIterator, slice::{ParallelSlice, ParallelSliceMut}, }; use crate::{ asyncjob::{AsyncJob, RunParams}, error::Result, sync::{self, CommitId, RepoPath, SharedCommitFilterFn}, AsyncGitNotification, ProgressPercent, }; use std::{ sync::{ atomic::{AtomicBool, AtomicUsize, Ordering}, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/error.rs
asyncgit/src/error.rs
use std::{ num::TryFromIntError, path::StripPrefixError, string::FromUtf8Error, }; use thiserror::Error; /// #[derive(Error, Debug)] pub enum GixError { /// #[error("gix::discover error: {0}")] Discover(#[from] Box<gix::discover::Error>), /// #[error("gix::head::peel::to_commit error: {0}")] HeadPeelToCommit(...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/pull.rs
asyncgit/src/pull.rs
use crate::{ error::{Error, Result}, sync::{ cred::BasicAuthCredential, remotes::{fetch, push::ProgressNotification}, RepoPath, }, AsyncGitNotification, RemoteProgress, }; use crossbeam_channel::{unbounded, Sender}; use std::{ sync::{Arc, Mutex}, thread, }; /// #[derive(Default, Clone, Debug)] pub struct F...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/progress.rs
asyncgit/src/progress.rs
//! use easy_cast::{Conv, ConvFloat}; use std::cmp; /// #[derive(Clone, Copy, Default, Debug, PartialEq, Eq)] pub struct ProgressPercent { /// percent 0..100 pub progress: u8, } impl ProgressPercent { /// pub fn new(current: usize, total: usize) -> Self { let total = f64::conv(cmp::max(current, total)); let ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/tags.rs
asyncgit/src/tags.rs
use crate::{ asyncjob::{AsyncJob, AsyncSingleJob, RunParams}, error::Result, hash, sync::{self, RepoPath}, AsyncGitNotification, }; use crossbeam_channel::Sender; use std::{ sync::{Arc, Mutex}, time::{Duration, Instant}, }; use sync::Tags; /// #[derive(Default, Clone)] pub struct TagsResult { hash: u64, tags:...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/treefiles.rs
asyncgit/src/treefiles.rs
use crate::{ asyncjob::{AsyncJob, RunParams}, error::Result, sync::{tree_files, CommitId, RepoPath, TreeFile}, AsyncGitNotification, }; use std::sync::{Arc, Mutex}; /// pub struct FileTreeResult { /// pub commit: CommitId, /// pub result: Result<Vec<TreeFile>>, } enum JobState { Request { commit: CommitId, r...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/revlog.rs
asyncgit/src/revlog.rs
use crate::{ error::Result, sync::{ gix_repo, repo, CommitId, LogWalker, LogWalkerWithoutFilter, RepoPath, SharedCommitFilterFn, }, AsyncGitNotification, Error, }; use crossbeam_channel::Sender; use scopetime::scope_time; use std::{ sync::{ atomic::{AtomicBool, Ordering}, Arc, Mutex, }, thread, time::{D...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/remote_tags.rs
asyncgit/src/remote_tags.rs
//! use crate::{ asyncjob::{AsyncJob, RunParams}, error::Result, sync::cred::BasicAuthCredential, sync::{ remotes::{get_default_remote, tags_missing_remote}, RepoPath, }, AsyncGitNotification, }; use std::sync::{Arc, Mutex}; enum JobState { Request(Option<BasicAuthCredential>), Response(Result<Vec<String...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/branches.rs
asyncgit/src/branches.rs
use crate::{ asyncjob::{AsyncJob, RunParams}, error::Result, sync::{branch::get_branches_info, BranchInfo, RepoPath}, AsyncGitNotification, }; use std::sync::{Arc, Mutex}; enum JobState { Request { local_branches: bool, repo: RepoPath, }, Response(Result<Vec<BranchInfo>>), } /// #[derive(Clone, Default)] p...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/asyncjob/mod.rs
asyncgit/src/asyncjob/mod.rs
//! provides `AsyncJob` trait and `AsyncSingleJob` struct #![deny(clippy::expect_used)] use crate::error::Result; use crossbeam_channel::Sender; use std::sync::{Arc, Mutex, RwLock}; /// Passed to `AsyncJob::run` allowing sending intermediate progress notifications pub struct RunParams< T: Copy + Send, P: Clone + S...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/cached/mod.rs
asyncgit/src/cached/mod.rs
//! cached lookups: //! parts of the sync api that might take longer //! to compute but change seldom so doing them async might be overkill mod branchname; pub use branchname::BranchName;
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/cached/branchname.rs
asyncgit/src/cached/branchname.rs
use crate::{ error::Result, sync::{self, branch::get_branch_name, RepoPathRef}, }; use sync::Head; /// pub struct BranchName { last_result: Option<(Head, String)>, repo: RepoPathRef, } impl BranchName { /// pub const fn new(repo: RepoPathRef) -> Self { Self { repo, last_result: None, } } /// pub f...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/merge.rs
asyncgit/src/sync/merge.rs
use crate::{ error::{Error, Result}, sync::{ branch::merge_commit::commit_merge_with_head, rebase::{ abort_rebase, continue_rebase, get_rebase_progress, }, repository::repo, reset_stage, reset_workdir, CommitId, }, }; use git2::{BranchType, Commit, MergeOptions, Repository}; use scopetime::scope_time; ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/config.rs
asyncgit/src/sync/config.rs
use crate::error::Result; use git2::Repository; use scopetime::scope_time; use serde::{Deserialize, Serialize}; use super::{repository::repo, RepoPath}; // see https://git-scm.com/docs/git-config#Documentation/git-config.txt-statusshowUntrackedFiles /// represents the `status.showUntrackedFiles` git config state #[de...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/ignore.rs
asyncgit/src/sync/ignore.rs
use super::{utils::work_dir, RepoPath}; use crate::{ error::{Error, Result}, sync::repository::repo, }; use scopetime::scope_time; use std::{ fs::{File, OpenOptions}, io::{Read, Seek, SeekFrom, Write}, path::Path, }; static GITIGNORE: &str = ".gitignore"; /// add file or path to root ignore file pub fn add_to_ig...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/blame.rs
asyncgit/src/sync/blame.rs
//! Sync git API for fetching a file blame use super::{utils, CommitId, RepoPath}; use crate::{ error::{Error, Result}, sync::{get_commits_info, repository::repo}, }; use git2::BlameOptions; use scopetime::scope_time; use std::collections::{HashMap, HashSet}; use std::io::{BufRead, BufReader}; use std::path::Path; ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/stash.rs
asyncgit/src/sync/stash.rs
use super::{CommitId, RepoPath}; use crate::{ error::{Error, Result}, sync::repository::repo, }; use git2::{ build::CheckoutBuilder, Oid, Repository, StashApplyOptions, StashFlags, }; use scopetime::scope_time; /// pub fn get_stashes(repo_path: &RepoPath) -> Result<Vec<CommitId>> { scope_time!("get_stashes"); l...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/commit_details.rs
asyncgit/src/sync/commit_details.rs
use super::{commits_info::get_message, CommitId, RepoPath}; use crate::{error::Result, sync::repository::repo}; use git2::Signature; use scopetime::scope_time; /// #[derive(Debug, PartialEq, Eq, Default, Clone)] pub struct CommitSignature { /// pub name: String, /// pub email: String, /// time in secs since Unix ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/rebase.rs
asyncgit/src/sync/rebase.rs
use git2::{BranchType, Repository}; use scopetime::scope_time; use crate::{ error::{Error, Result}, sync::repository::repo, }; use super::{CommitId, RepoPath}; /// rebase current HEAD on `branch` pub fn rebase_branch( repo_path: &RepoPath, branch: &str, branch_type: BranchType, ) -> Result<RebaseState> { scope...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/diff.rs
asyncgit/src/sync/diff.rs
//! sync git api for fetching a diff use super::{ commit_files::{ get_commit_diff, get_compare_commits_diff, OldNew, }, utils::{get_head_repo, work_dir}, CommitId, RepoPath, }; use crate::{ error::Error, error::Result, hash, sync::{get_stashes, repository::repo}, }; use easy_cast::Conv; use git2::{ Delta, D...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/commit_files.rs
asyncgit/src/sync/commit_files.rs
//! Functions for getting infos about files in commits use super::{diff::DiffOptions, CommitId, RepoPath}; use crate::{ error::Result, sync::{get_stashes, repository::repo}, StatusItem, StatusItemType, }; use git2::{Diff, Repository}; use scopetime::scope_time; use std::collections::HashSet; /// struct containing ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/sign.rs
asyncgit/src/sync/sign.rs
//! Sign commit data. use ssh_key::{HashAlg, LineEnding, PrivateKey}; use std::path::PathBuf; /// Error type for [`SignBuilder`], used to create [`Sign`]'s #[derive(thiserror::Error, Debug)] pub enum SignBuilderError { /// The given format is invalid #[error("Failed to derive a commit signing method from git config...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/status.rs
asyncgit/src/sync/status.rs
//! sync git api for fetching a status use crate::{ error::Result, sync::{ config::untracked_files_config_repo, repository::{gix_repo, repo}, }, }; use git2::{Delta, Status, StatusOptions, StatusShow}; use scopetime::scope_time; use std::path::Path; use super::{RepoPath, ShowUntrackedFilesConfig}; /// #[deriv...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/state.rs
asyncgit/src/sync/state.rs
use super::RepoPath; use crate::{error::Result, sync::repository::repo}; use git2::RepositoryState; use scopetime::scope_time; /// #[derive(Debug, PartialEq, Eq)] pub enum RepoState { /// Clean, /// Merge, /// Rebase, /// Revert, /// Other, } impl From<RepositoryState> for RepoState { fn from(state: Reposi...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/tree.rs
asyncgit/src/sync/tree.rs
use super::{CommitId, RepoPath}; use crate::{ error::{Error, Result}, sync::repository::repo, }; use git2::{Oid, Repository, Tree}; use scopetime::scope_time; use std::{ cmp::Ordering, path::{Path, PathBuf}, }; /// `tree_files` returns a list of `FileTree` #[derive(Debug, PartialEq, Eq, Clone)] pub struct TreeFile...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/commit.rs
asyncgit/src/sync/commit.rs
//! Git Api for Commits use super::{CommitId, RepoPath}; use crate::sync::sign::{SignBuilder, SignError}; use crate::{ error::{Error, Result}, sync::{repository::repo, utils::get_head_repo}, }; use git2::{ message_prettify, ErrorCode, ObjectType, Repository, Signature, }; use scopetime::scope_time; /// pub fn amend...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/utils.rs
asyncgit/src/sync/utils.rs
//! sync git api (various methods) use super::{ repository::repo, CommitId, RepoPath, ShowUntrackedFilesConfig, }; use crate::{ error::{Error, Result}, sync::config::untracked_files_config_repo, }; use git2::{IndexAddOption, Repository, RepositoryOpenFlags}; use scopetime::scope_time; use std::{ fs::File, io::Wri...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/hooks.rs
asyncgit/src/sync/hooks.rs
use super::{repository::repo, RepoPath}; use crate::error::Result; pub use git2_hooks::PrepareCommitMsgSource; use scopetime::scope_time; /// #[derive(Debug, PartialEq, Eq)] pub enum HookResult { /// Everything went fine Ok, /// Hook returned error NotOk(String), } impl From<git2_hooks::HookResult> for HookResult...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/hunks.rs
asyncgit/src/sync/hunks.rs
use super::{ diff::{get_diff_raw, DiffOptions, HunkHeader}, RepoPath, }; use crate::{ error::{Error, Result}, hash, sync::repository::repo, }; use git2::{ApplyLocation, ApplyOptions, Diff}; use scopetime::scope_time; /// pub fn stage_hunk( repo_path: &RepoPath, file_path: &str, hunk_hash: u64, options: Option...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/cred.rs
asyncgit/src/sync/cred.rs
//! credentials git helper use super::{ remotes::{ get_default_remote_for_fetch_in_repo, get_default_remote_for_push_in_repo, get_default_remote_in_repo, }, repository::repo, RepoPath, }; use crate::error::{Error, Result}; use git2::CredentialHelper; /// basic Authentication Credentials #[derive(Debug, Clon...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/mod.rs
asyncgit/src/sync/mod.rs
//! sync git api //TODO: remove once we have this activated on the toplevel #![deny(clippy::expect_used)] pub mod blame; pub mod branch; pub mod commit; mod commit_details; pub mod commit_files; mod commit_filter; mod commit_revert; mod commits_info; mod config; pub mod cred; pub mod diff; mod hooks; mod hunks; mod i...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/commit_filter.rs
asyncgit/src/sync/commit_filter.rs
use super::{ commit_details::get_author_of_commit, commit_files::get_commit_diff, CommitId, }; use crate::error::Result; use bitflags::bitflags; use fuzzy_matcher::FuzzyMatcher; use git2::{Diff, Repository}; use std::sync::Arc; /// pub type SharedCommitFilterFn = Arc< Box<dyn Fn(&Repository, &CommitId) -> Result<bo...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/commit_revert.rs
asyncgit/src/sync/commit_revert.rs
use super::{CommitId, RepoPath}; use crate::{ error::Result, sync::{repository::repo, utils::read_file}, }; use scopetime::scope_time; const GIT_REVERT_HEAD_FILE: &str = "REVERT_HEAD"; /// pub fn revert_commit( repo_path: &RepoPath, commit: CommitId, ) -> Result<()> { scope_time!("revert"); let repo = repo(rep...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/patches.rs
asyncgit/src/sync/patches.rs
use super::diff::{get_diff_raw, DiffOptions, HunkHeader}; use crate::error::{Error, Result}; use git2::{Diff, DiffLine, Patch, Repository}; pub struct HunkLines<'a> { pub hunk: HunkHeader, pub lines: Vec<DiffLine<'a>>, } pub fn get_file_diff_patch<'a>( repo: &'a Repository, file: &str, is_staged: bool, reverse:...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/tags.rs
asyncgit/src/sync/tags.rs
use super::{get_commits_info, CommitId, RepoPath}; use crate::{ error::Result, sync::{gix_repo, repository::repo}, }; use scopetime::scope_time; use std::collections::{BTreeMap, HashMap, HashSet}; /// #[derive(Clone, Hash, PartialEq, Eq, Debug)] pub struct Tag { /// tag name pub name: String, /// tag annotation ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/logwalker.rs
asyncgit/src/sync/logwalker.rs
use super::{CommitId, SharedCommitFilterFn}; use crate::error::Result; use git2::{Commit, Oid, Repository}; use gix::revision::Walk; use std::{ cmp::Ordering, collections::{BinaryHeap, HashSet}, }; struct TimeOrderedCommit<'a>(Commit<'a>); impl Eq for TimeOrderedCommit<'_> {} impl PartialEq for TimeOrderedCommit<'...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/commits_info.rs
asyncgit/src/sync/commits_info.rs
use std::fmt::Display; use super::RepoPath; use crate::{ error::Result, sync::{ commit_details::get_author_of_commit, repository::{gix_repo, repo}, }, }; use git2::{Commit, Error, Oid}; use scopetime::scope_time; use unicode_truncate::UnicodeTruncateStr; /// identifies a single commit #[derive( Debug, Copy, C...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/submodules.rs
asyncgit/src/sync/submodules.rs
use std::path::{Path, PathBuf}; use git2::{ Repository, RepositoryOpenFlags, Submodule, SubmoduleUpdateOptions, }; use scopetime::scope_time; use super::{repo, CommitId, RepoPath}; use crate::{error::Result, sync::utils::work_dir, Error}; pub use git2::SubmoduleStatus; /// #[derive(Debug)] pub struct SubmoduleInf...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/reset.rs
asyncgit/src/sync/reset.rs
use super::{utils::get_head_repo, CommitId, RepoPath}; use crate::{error::Result, sync::repository::repo}; use git2::{build::CheckoutBuilder, ObjectType, ResetType}; use scopetime::scope_time; /// pub fn reset_stage(repo_path: &RepoPath, path: &str) -> Result<()> { scope_time!("reset_stage"); let repo = repo(repo_p...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/reword.rs
asyncgit/src/sync/reword.rs
use git2::{Oid, RebaseOptions, Repository}; use super::{ commit::signature_allow_undefined_name, repo, utils::{bytes2string, get_head_refname, get_head_repo}, CommitId, RepoPath, }; use crate::error::{Error, Result}; /// This is the same as reword, but will abort and fix the repo if something goes wrong pub fn re...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/repository.rs
asyncgit/src/sync/repository.rs
use std::{ cell::RefCell, path::{Path, PathBuf}, }; use git2::{Repository, RepositoryOpenFlags}; use crate::error::Result; /// pub type RepoPathRef = RefCell<RepoPath>; /// #[derive(Clone, Debug)] pub enum RepoPath { /// Path(PathBuf), /// Workdir { /// gitdir: PathBuf, /// workdir: PathBuf, }, } im...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/remotes/push.rs
asyncgit/src/sync/remotes/push.rs
use crate::{ error::{Error, Result}, progress::ProgressPercent, sync::{ branch::branch_set_upstream_after_push, config::{ push_default_strategy_config_repo, PushDefaultStrategyConfig, }, cred::BasicAuthCredential, get_branch_upstream_merge, remotes::{proxy_auto, Callbacks}, repository::repo, Co...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/remotes/callbacks.rs
asyncgit/src/sync/remotes/callbacks.rs
use super::push::ProgressNotification; use crate::{error::Result, sync::cred::BasicAuthCredential}; use crossbeam_channel::Sender; use git2::{Cred, Error as GitError, RemoteCallbacks}; use std::sync::{ atomic::{AtomicBool, Ordering}, Arc, Mutex, }; /// #[derive(Default, Clone)] pub struct CallbackStats { pub push_r...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/remotes/mod.rs
asyncgit/src/sync/remotes/mod.rs
//! mod callbacks; pub(crate) mod push; pub(crate) mod tags; use crate::{ error::{Error, Result}, sync::{ cred::BasicAuthCredential, remotes::push::ProgressNotification, repository::repo, utils, }, ProgressPercent, }; use crossbeam_channel::Sender; use git2::{ BranchType, FetchOptions, ProxyOptions, Remote, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/remotes/tags.rs
asyncgit/src/sync/remotes/tags.rs
//! use super::push::AsyncProgress; use crate::{ error::Result, progress::ProgressPercent, sync::{ cred::BasicAuthCredential, remotes::{proxy_auto, Callbacks}, repository::repo, RepoPath, }, }; use crossbeam_channel::Sender; use git2::{Direction, PushOptions}; use scopetime::scope_time; use std::collection...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/branch/merge_rebase.rs
asyncgit/src/sync/branch/merge_rebase.rs
//! merging from upstream (rebase) use crate::{ error::{Error, Result}, sync::{ rebase::conflict_free_rebase, repository::repo, CommitId, RepoPath, }, }; use git2::BranchType; use scopetime::scope_time; /// tries merging current branch with its upstream using rebase pub fn merge_upstream_rebase( repo_path: &R...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/branch/rename.rs
asyncgit/src/sync/branch/rename.rs
//! renaming of branches use crate::{ error::Result, sync::{repository::repo, RepoPath}, }; use scopetime::scope_time; /// Rename the branch reference pub fn rename_branch( repo_path: &RepoPath, branch_ref: &str, new_name: &str, ) -> Result<()> { scope_time!("rename_branch"); let repo = repo(repo_path)?; let...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/branch/merge_commit.rs
asyncgit/src/sync/branch/merge_commit.rs
//! merging from upstream use super::BranchType; use crate::{ error::{Error, Result}, sync::{merge_msg, repository::repo, CommitId, RepoPath}, }; use git2::Commit; use scopetime::scope_time; /// merge upstream using a merge commit if we did not create conflicts. /// if we did not create conflicts we create a merge ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/branch/mod.rs
asyncgit/src/sync/branch/mod.rs
//! branch functions pub mod merge_commit; pub mod merge_ff; pub mod merge_rebase; pub mod rename; use super::{utils::bytes2string, RepoPath}; use crate::{ error::{Error, Result}, sync::{ remotes::get_default_remote_for_push_in_repo, repository::repo, utils::get_head_repo, CommitId, }, }; use git2::{Branch, Br...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/branch/merge_ff.rs
asyncgit/src/sync/branch/merge_ff.rs
//! merging from upstream use super::BranchType; use crate::{ error::{Error, Result}, sync::{repository::repo, RepoPath}, }; use scopetime::scope_time; /// pub fn branch_merge_upstream_fastforward( repo_path: &RepoPath, branch: &str, ) -> Result<()> { scope_time!("branch_merge_upstream"); let repo = repo(repo_...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/staging/discard_tracked.rs
asyncgit/src/sync/staging/discard_tracked.rs
use super::{apply_selection, load_file}; use crate::{ error::Result, sync::{ diff::DiffLinePosition, patches::get_file_diff_patch, patches::patch_get_hunklines, repository::repo, utils::repo_write_file, RepoPath, }, }; use scopetime::scope_time; /// discards specific lines in an unstaged hunk of a diff pub fn...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/staging/mod.rs
asyncgit/src/sync/staging/mod.rs
mod discard_tracked; mod stage_tracked; pub use discard_tracked::discard_lines; pub use stage_tracked::stage_lines; use super::{ diff::DiffLinePosition, patches::HunkLines, utils::work_dir, }; use crate::error::Result; use git2::{DiffLine, DiffLineType, Repository}; use std::{collections::HashSet, fs::File, io::Read...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/asyncgit/src/sync/staging/stage_tracked.rs
asyncgit/src/sync/staging/stage_tracked.rs
use super::apply_selection; use crate::{ error::{Error, Result}, sync::{ diff::DiffLinePosition, patches::get_file_diff_patch, patches::patch_get_hunklines, repository::repo, RepoPath, }, }; use easy_cast::Conv; use scopetime::scope_time; use std::path::Path; /// pub fn stage_lines( repo_path: &RepoPath, file...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/filetreelist/src/lib.rs
filetreelist/src/lib.rs
// #![forbid(missing_docs)] #![forbid(unsafe_code)] #![deny( mismatched_lifetime_syntaxes, unused_imports, unused_must_use, dead_code, unstable_name_collisions, unused_assignments )] #![deny(clippy::all, clippy::perf, clippy::nursery, clippy::pedantic)] #![deny(clippy::expect_used)] #![deny(clippy::filetype_is_fi...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/filetreelist/src/filetree.rs
filetreelist/src/filetree.rs
use crate::{ error::Result, filetreeitems::FileTreeItems, tree_iter::TreeIterator, TreeItemInfo, }; use std::{cell::Cell, collections::BTreeSet, path::Path}; /// #[derive(Copy, Clone, Debug)] pub enum MoveSelection { Up, Down, Left, Right, Top, End, PageDown, PageUp, } #[derive(Clone, Copy, PartialEq)] enum...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/filetreelist/src/error.rs
filetreelist/src/error.rs
use std::{num::TryFromIntError, path::PathBuf}; use thiserror::Error; #[derive(Error, Debug)] pub enum Error { #[error("InvalidPath: `{0}`")] InvalidPath(PathBuf), #[error("TryFromInt error:{0}")] IntConversion(#[from] TryFromIntError), } pub type Result<T> = std::result::Result<T, Error>;
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/filetreelist/src/filetreeitems.rs
filetreelist/src/filetreeitems.rs
use crate::{ error::Error, item::{FileTreeItemKind, PathCollapsed}, FileTreeItem, }; use crate::{error::Result, treeitems_iter::TreeItemsIterator}; use std::{ collections::{BTreeSet, HashMap}, path::{Path, PathBuf}, }; /// #[derive(Default)] pub struct FileTreeItems { pub tree_items: Vec<FileTreeItem>, files: u...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/filetreelist/src/item.rs
filetreelist/src/item.rs
use crate::error::Result; use std::path::{Path, PathBuf}; /// holds the information shared among all `FileTreeItem` in a `FileTree` #[derive(Debug, Clone)] pub struct TreeItemInfo { /// indent level indent: u8, /// currently visible depending on the folder collapse states visible: bool, /// contains this paths la...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/filetreelist/src/tree_iter.rs
filetreelist/src/tree_iter.rs
use crate::{item::FileTreeItem, treeitems_iter::TreeItemsIterator}; pub struct TreeIterator<'a> { item_iter: TreeItemsIterator<'a>, selection: Option<usize>, } impl<'a> TreeIterator<'a> { pub const fn new( item_iter: TreeItemsIterator<'a>, selection: Option<usize>, ) -> Self { Self { item_iter, select...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false