Skip to content

Commit

Permalink
cargo update (related to #1781)
Browse files Browse the repository at this point in the history
  • Loading branch information
extrawurst committed Oct 19, 2023
1 parent d285440 commit 823a328
Show file tree
Hide file tree
Showing 9 changed files with 218 additions and 146 deletions.
242 changes: 152 additions & 90 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@ keywords = ["git", "gui", "cli", "terminal", "ui"]
anyhow = "1.0"
asyncgit = { path = "./asyncgit", version = "0.24", default-features = false }
backtrace = "0.3"
bitflags = "1.3"
bitflags = "2.4"
bugreport = "0.5"
bwrap = { version = "1.3.0", features = ["use_std"] }
bytesize = { version = "1.3", default-features = false }
chrono = { version = "0.4", default-features = false, features = ["clock"] }
clap = { version = "4.4", features = ["env", "cargo"] }
crossbeam-channel = "0.5"
crossterm = { version = "0.26.1", features = ["serde"] }
crossterm = { version = "0.27", features = ["serde"] }
dirs = "5.0"
easy-cast = "0.5"
filetreelist = { path = "./filetreelist", version = "0.5" }
fuzzy-matcher = "0.3"
gh-emoji = { version = "1.0", optional = true }
indexmap = "1.9"
indexmap = "2.0"
itertools = "0.11"
log = "0.4"
notify = "5.1"
notify-debouncer-mini = "0.2"
notify = "6.1"
notify-debouncer-mini = "0.4"
once_cell = "1"
ratatui = { version = "0.21", default-features = false, features = ['crossterm', 'serde'] }
ratatui = { version = "0.23", default-features = false, features = ['crossterm', 'serde'] }
rayon-core = "1.11"
ron = "0.8"
scopeguard = "1.2"
scopetime = { path = "./scopetime", version = "0.1" }
serde = "1.0"
shellexpand = "3.1"
simplelog = { version = "0.12", default-features = false }
struct-patch = "0.2"
syntect = { version = "5.0", default-features = false, features = ["parsing", "default-syntaxes", "default-themes", "html"] }
struct-patch = "0.4"
syntect = { version = "5.1", default-features = false, features = ["parsing", "default-syntaxes", "default-themes", "html"] }
unicode-segmentation = "1.10"
unicode-truncate = "0.2"
unicode-width = "0.1"
Expand Down
6 changes: 3 additions & 3 deletions asyncgit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ categories = ["concurrency", "asynchronous"]
keywords = ["git"]

[dependencies]
bitflags = "1"
bitflags = "2"
crossbeam-channel = "0.5"
easy-cast = "0.5"
fuzzy-matcher = "0.3"
git2 = "0.17"
git2 = "0.18"
log = "0.4"
# git2 = { path = "../../extern/git2-rs", features = ["vendored-openssl"]}
# git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="fc13dcc", features = ["vendored-openssl"]}
Expand All @@ -35,7 +35,7 @@ url = "2.4"
env_logger = "0.10"
invalidstring = { path = "../invalidstring", version = "0.1" }
pretty_assertions = "1.4"
serial_test = "1.0"
serial_test = "2.0"
tempfile = "3.4"

[features]
Expand Down
3 changes: 2 additions & 1 deletion asyncgit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
//TODO:
#![allow(
clippy::significant_drop_tightening,
clippy::missing_panics_doc
clippy::missing_panics_doc,
clippy::multiple_crate_versions
)]

pub mod asyncjob;
Expand Down
2 changes: 2 additions & 0 deletions asyncgit/src/sync/commit_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub fn diff_contains_file(file_path: String) -> SharedCommitFilterFn {

bitflags! {
///
#[derive(Debug, Clone, Copy)]
pub struct SearchFields: u32 {
///
const MESSAGE_SUMMARY = 1 << 0;
Expand All @@ -59,6 +60,7 @@ impl Default for SearchFields {

bitflags! {
///
#[derive(Debug, Clone, Copy)]
pub struct SearchOptions: u32 {
///
const CASE_SENSITIVE = 1 << 0;
Expand Down
12 changes: 6 additions & 6 deletions src/keys/key_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,23 @@ mod tests {
NamedTempFile::new_in(&app_home).unwrap();
writeln!(
temporary_key_list,
r"
r#"
(
move_down: Some(( code: Char('j'), modifiers: ( bits: 2,),)),
move_down: Some(( code: Char('j'), modifiers: "CONTROL")),
)
"
"#
)
.unwrap();

let mut temporary_key_symbols =
NamedTempFile::new_in(&app_home).unwrap();
writeln!(
temporary_key_symbols,
"
r#"
(
esc: Some(\"Esc\"),
esc: Some("Esc"),
)
"
"#
)
.unwrap();

Expand Down
25 changes: 18 additions & 7 deletions src/keys/key_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ impl From<&GituiKeyEvent> for KeyEvent {
}
}

#[derive(Clone, Patch)]
#[patch_derive(Deserialize)]
#[derive(Debug, Clone, Patch)]
#[patch_derive(Deserialize, Debug)]
pub struct KeysList {
pub tab_status: GituiKeyEvent,
pub tab_log: GituiKeyEvent,
Expand Down Expand Up @@ -217,8 +217,11 @@ impl KeysList {
pub fn init(file: PathBuf) -> Self {
let mut keys_list = Self::default();
if let Ok(f) = File::open(file) {
if let Ok(patch) = ron::de::from_reader(f) {
keys_list.apply(patch);
match ron::de::from_reader(f) {
Ok(patch) => keys_list.apply(patch),
Err(e) => {
log::error!("KeysList parse error: {e}");
}
}
}
keys_list
Expand Down Expand Up @@ -248,11 +251,12 @@ mod tests {

writeln!(
file,
r"
r#"
(
move_down: Some(( code: Char('j'), modifiers: ( bits: 2,),)),
move_down: Some(( code: Char('j'), modifiers: "CONTROL")),
move_up: Some((code: Char('h'), modifiers: ""))
)
"
"#
)
.unwrap();

Expand All @@ -266,5 +270,12 @@ mod tests {
KeyModifiers::CONTROL
)
);
assert_eq!(
keys.move_up,
GituiKeyEvent::new(
KeyCode::Char('h'),
KeyModifiers::NONE
)
);
}
}
14 changes: 5 additions & 9 deletions src/watcher.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use crossbeam_channel::{unbounded, Sender};
use notify::{Error, RecommendedWatcher, RecursiveMode, Watcher};
use notify_debouncer_mini::{new_debouncer, DebouncedEvent};
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
use notify_debouncer_mini::{new_debouncer, DebounceEventResult};
use scopetime::scope_time;
use std::{path::Path, thread, time::Duration};

Expand Down Expand Up @@ -43,9 +43,7 @@ impl RepoWatcher {
}

fn forwarder(
receiver: &std::sync::mpsc::Receiver<
Result<Vec<DebouncedEvent>, Vec<Error>>,
>,
receiver: &std::sync::mpsc::Receiver<DebounceEventResult>,
sender: &Sender<()>,
) -> Result<()> {
loop {
Expand All @@ -68,15 +66,13 @@ impl RepoWatcher {

fn create_watcher(
timeout: Duration,
tx: std::sync::mpsc::Sender<
Result<Vec<DebouncedEvent>, Vec<Error>>,
>,
tx: std::sync::mpsc::Sender<DebounceEventResult>,
workdir: &str,
) {
scope_time!("create_watcher");

let mut bouncer =
new_debouncer(timeout, None, tx).expect("Watch create error");
new_debouncer(timeout, tx).expect("Watch create error");
bouncer
.watcher()
.watch(Path::new(&workdir), RecursiveMode::Recursive)
Expand Down
44 changes: 22 additions & 22 deletions vim_style_key_config.ron
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@
// Note:
// If the default key layout is lower case,
// and you want to use `Shift + q` to trigger the exit event,
// the setting should like this `exit: Some(( code: Char('Q'), modifiers: ( bits: 1,),)),`
// the setting should like this `exit: Some(( code: Char('Q'), modifiers: "SHIFT")),`
// The Char should be upper case, and the shift modified bit should be set to 1.
//
// Note:
// find `KeysList` type in src/keys/key_list.rs for all possible keys.
// every key not overwritten via the config file will use the default specified there
(
open_help: Some(( code: F(1), modifiers: ( bits: 0,),)),
open_help: Some(( code: F(1), modifiers: "")),

move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
move_left: Some(( code: Char('h'), modifiers: "")),
move_right: Some(( code: Char('l'), modifiers: "")),
move_up: Some(( code: Char('k'), modifiers: "")),
move_down: Some(( code: Char('j'), modifiers: "")),

popup_up: Some(( code: Char('p'), modifiers: ( bits: 2,),)),
popup_down: Some(( code: Char('n'), modifiers: ( bits: 2,),)),
page_up: Some(( code: Char('b'), modifiers: ( bits: 2,),)),
page_down: Some(( code: Char('f'), modifiers: ( bits: 2,),)),
home: Some(( code: Char('g'), modifiers: ( bits: 0,),)),
end: Some(( code: Char('G'), modifiers: ( bits: 1,),)),
shift_up: Some(( code: Char('K'), modifiers: ( bits: 1,),)),
shift_down: Some(( code: Char('J'), modifiers: ( bits: 1,),)),
popup_up: Some(( code: Char('p'), modifiers: "CONTROL")),
popup_down: Some(( code: Char('n'), modifiers: "CONTROL")),
page_up: Some(( code: Char('b'), modifiers: "CONTROL")),
page_down: Some(( code: Char('f'), modifiers: "CONTROL")),
home: Some(( code: Char('g'), modifiers: "")),
end: Some(( code: Char('G'), modifiers: "SHIFT")),
shift_up: Some(( code: Char('K'), modifiers: "SHIFT")),
shift_down: Some(( code: Char('J'), modifiers: "SHIFT")),

edit_file: Some(( code: Char('I'), modifiers: ( bits: 1,),)),
edit_file: Some(( code: Char('I'), modifiers: "SHIFT")),

status_reset_item: Some(( code: Char('U'), modifiers: ( bits: 1,),)),
status_reset_item: Some(( code: Char('U'), modifiers: "SHIFT")),

diff_reset_lines: Some(( code: Char('u'), modifiers: ( bits: 0,),)),
diff_stage_lines: Some(( code: Char('s'), modifiers: ( bits: 0,),)),
diff_reset_lines: Some(( code: Char('u'), modifiers: "")),
diff_stage_lines: Some(( code: Char('s'), modifiers: "")),

stashing_save: Some(( code: Char('w'), modifiers: ( bits: 0,),)),
stashing_toggle_index: Some(( code: Char('m'), modifiers: ( bits: 0,),)),
stashing_save: Some(( code: Char('w'), modifiers: "")),
stashing_toggle_index: Some(( code: Char('m'), modifiers: "")),

stash_open: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
stash_open: Some(( code: Char('l'), modifiers: "")),

abort_merge: Some(( code: Char('M'), modifiers: ( bits: 1,),)),
abort_merge: Some(( code: Char('M'), modifiers: "SHIFT")),
)

0 comments on commit 823a328

Please sign in to comment.