Skip to content
Closed
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
224 changes: 119 additions & 105 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ vendor-openssl = ["asyncgit/vendor-openssl"]
[dependencies]
anyhow = "1.0"
asyncgit = { path = "./asyncgit", version = "0.27.0", default-features = false }
backtrace = "0.3"
# 2025-09-18 backtrace >=0.3.75 requires Rust 1.82.0 while we’re still at
# 1.81.0.
backtrace = "=0.3.74"
base64 = "0.22"
bitflags = "2.9"
bugreport = "0.5.1"
Expand All @@ -58,7 +60,7 @@ notify = "8"
notify-debouncer-mini = "0.6"
once_cell = "1"
# pin until upgrading this does not introduce a duplicate dependency
parking_lot_core = "=0.9.10"
parking_lot_core = "=0.9.11"
ratatui = { version = "0.29", default-features = false, features = [
'crossterm',
'serde',
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/asyncjob/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl<J: 'static + AsyncJob> AsyncSingleJob<J> {
let self_clone = (*self).clone();
rayon_core::spawn(move || {
if let Err(e) = self_clone.run_job(task) {
log::error!("async job error: {}", e);
log::error!("async job error: {e}");
}
});

Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/blame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl AsyncBlame {

let notify = match notify {
Err(err) => {
log::error!("get_blame_helper error: {}", err);
log::error!("get_blame_helper error: {err}");
true
}
Ok(notify) => notify,
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/commit_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl AsyncCommitFiles {
return Ok(());
}

log::trace!("request: {:?}", params);
log::trace!("request: {params:?}");

{
let current = self.current.lock()?;
Expand Down
4 changes: 2 additions & 2 deletions asyncgit/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl AsyncDiff {
&self,
params: DiffParams,
) -> Result<Option<FileDiff>> {
log::trace!("request {:?}", params);
log::trace!("request {params:?}");

let hash = hash(&params);

Expand Down Expand Up @@ -132,7 +132,7 @@ impl AsyncDiff {

let notify = match notify {
Err(err) => {
log::error!("get_diff_helper error: {}", err);
log::error!("get_diff_helper error: {err}");
true
}
Ok(notify) => notify,
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl AsyncPull {
*last_res = match res {
Ok(bytes) => Some((bytes, String::new())),
Err(e) => {
log::error!("fetch error: {}", e);
log::error!("fetch error: {e}");
Some((0, e.to_string()))
}
};
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl AsyncPush {
*last_res = match res {
Ok(()) => None,
Err(e) => {
log::error!("push error: {}", e);
log::error!("push error: {e}");
Some(e.to_string())
}
};
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/push_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl AsyncPushTags {
*last_res = match res {
Ok(()) => None,
Err(e) => {
log::error!("push error: {}", e);
log::error!("push error: {e}");
Some(e.to_string())
}
};
Expand Down
3 changes: 1 addition & 2 deletions asyncgit/src/remote_progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ impl RemoteProgress {
}
Err(e) => {
log::error!(
"remote progress receiver error: {}",
e
"remote progress receiver error: {e}"
);
break;
}
Expand Down
6 changes: 2 additions & 4 deletions asyncgit/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl AsyncStatus {
&arc_current,
&arc_last,
) {
log::error!("fetch_helper: {}", e);
log::error!("fetch_helper: {e}");
}

arc_pending.fetch_sub(1, Ordering::Relaxed);
Expand All @@ -158,9 +158,7 @@ impl AsyncStatus {
) -> Result<()> {
let res = Self::get_status(repo, status_type, config)?;
log::trace!(
"status fetched: {} (type: {:?})",
hash_request,
status_type,
"status fetched: {hash_request} (type: {status_type:?})",
);

{
Expand Down
17 changes: 5 additions & 12 deletions asyncgit/src/sync/remotes/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ impl Callbacks {
reference: &str,
msg: Option<&str>,
) {
log::debug!(
"push_update_reference: '{}' {:?}",
reference,
msg
);
log::debug!("push_update_reference: '{reference}' {msg:?}");

if let Ok(mut stats) = self.stats.lock() {
stats.push_rejected_msg = msg
Expand All @@ -125,7 +121,7 @@ impl Callbacks {
total: usize,
current: usize,
) {
log::debug!("packing: {:?} - {}/{}", stage, current, total);
log::debug!("packing: {stage:?} - {current}/{total}");
self.sender.clone().map(|sender| {
sender.send(ProgressNotification::Packing {
stage,
Expand All @@ -150,7 +146,7 @@ impl Callbacks {
}

fn update_tips(&self, name: &str, a: git2::Oid, b: git2::Oid) {
log::debug!("update tips: '{}' [{}] [{}]", name, a, b);
log::debug!("update tips: '{name}' [{a}] [{b}]");
self.sender.clone().map(|sender| {
sender.send(ProgressNotification::UpdateTips {
name: name.to_string(),
Expand All @@ -166,7 +162,7 @@ impl Callbacks {
total: usize,
bytes: usize,
) {
log::debug!("progress: {}/{} ({} B)", current, total, bytes,);
log::debug!("progress: {current}/{total} ({bytes} B)",);
self.sender.clone().map(|sender| {
sender.send(ProgressNotification::PushTransfer {
current,
Expand All @@ -187,10 +183,7 @@ impl Callbacks {
allowed_types: git2::CredentialType,
) -> std::result::Result<Cred, GitError> {
log::debug!(
"creds: '{}' {:?} ({:?})",
url,
username_from_url,
allowed_types
"creds: '{url}' {username_from_url:?} ({allowed_types:?})"
);

// This boolean is used to avoid multiple calls to credentials callback.
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/sync/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl From<RepositoryState> for RepoState {
RepositoryState::Revert => Self::Revert,
RepositoryState::RebaseMerge => Self::Rebase,
_ => {
log::warn!("state not supported yet: {:?}", state);
log::warn!("state not supported yet: {state:?}");
Self::Other
}
}
Expand Down
8 changes: 4 additions & 4 deletions asyncgit/src/sync/submodules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,26 @@ pub fn submodule_parent_info(
let repo = repo(repo_path)?;
let repo_wd = work_dir(&repo)?.to_path_buf();

log::trace!("[sub] repo_wd: {:?}", repo_wd);
log::trace!("[sub] repo_wd: {repo_wd:?}");
log::trace!("[sub] repo_path: {:?}", repo.path());

if let Some(parent_path) = repo_wd.parent() {
log::trace!("[sub] parent_path: {:?}", parent_path);
log::trace!("[sub] parent_path: {parent_path:?}");

if let Ok(parent) = Repository::open_ext(
parent_path,
RepositoryOpenFlags::FROM_ENV,
Vec::<&Path>::new(),
) {
let parent_wd = work_dir(&parent)?.to_path_buf();
log::trace!("[sub] parent_wd: {:?}", parent_wd);
log::trace!("[sub] parent_wd: {parent_wd:?}");

let submodule_name = repo_wd
.strip_prefix(parent_wd)?
.to_string_lossy()
.to_string();

log::trace!("[sub] submodule_name: {:?}", submodule_name);
log::trace!("[sub] submodule_name: {submodule_name:?}");

if let Ok(submodule) =
parent.find_submodule(&submodule_name)
Expand Down
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl App {

///
pub fn event(&mut self, ev: InputEvent) -> Result<()> {
log::trace!("event: {:?}", ev);
log::trace!("event: {ev:?}");

if let InputEvent::Input(ev) = ev {
if self.check_hard_exit(&ev) || self.check_quit(&ev) {
Expand Down Expand Up @@ -402,7 +402,7 @@ impl App {
&mut self,
ev: AsyncNotification,
) -> Result<()> {
log::trace!("update_async: {:?}", ev);
log::trace!("update_async: {ev:?}");

if let AsyncNotification::Git(ev) = ev {
self.status_tab.update_git(ev)?;
Expand Down Expand Up @@ -1061,7 +1061,7 @@ impl App {
));
}
Err(e) => {
log::error!("delete remote: {}", e,);
log::error!("delete remote: {e}",);
self.queue.push(InternalEvent::ShowErrorMsg(
format!("delete remote error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Input {
if let Err(e) =
Self::input_loop(&arc_desired, &arc_current, &tx)
{
log::error!("input thread error: {}", e);
log::error!("input thread error: {e}");
arc_aborted.store(true, Ordering::SeqCst);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ fn draw(terminal: &mut Terminal, app: &App) -> io::Result<()> {

terminal.draw(|f| {
if let Err(e) = app.draw(f) {
log::error!("failed to draw: {:?}", e);
log::error!("failed to draw: {e:?}");
}
})?;

Expand Down
2 changes: 1 addition & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl Options {

fn save(&self) {
if let Err(e) = self.save_failable() {
log::error!("options save error: {}", e);
log::error!("options save error: {e}");
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/popups/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl CommitPopup {
if let HookResult::NotOk(e) =
sync::hooks_pre_commit(&self.repo.borrow())?
{
log::error!("pre-commit hook error: {}", e);
log::error!("pre-commit hook error: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("pre-commit hook error:\n{e}"),
));
Expand All @@ -256,7 +256,7 @@ impl CommitPopup {
if let HookResult::NotOk(e) =
sync::hooks_commit_msg(&self.repo.borrow(), &mut msg)?
{
log::error!("commit-msg hook error: {}", e);
log::error!("commit-msg hook error: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("commit-msg hook error:\n{e}"),
));
Expand All @@ -268,7 +268,7 @@ impl CommitPopup {
if let HookResult::NotOk(e) =
sync::hooks_post_commit(&self.repo.borrow())?
{
log::error!("post-commit hook error: {}", e);
log::error!("post-commit hook error: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(format!(
"post-commit hook error:\n{e}"
)));
Expand Down Expand Up @@ -400,7 +400,7 @@ impl CommitPopup {
"commit.template",
)
.map_err(|e| {
log::error!("load git-config failed: {}", e);
log::error!("load git-config failed: {e}");
e
})
.ok()
Expand All @@ -415,7 +415,7 @@ impl CommitPopup {
.and_then(|path| {
read_to_string(&path)
.map_err(|e| {
log::error!("read commit.template failed: {e} (path: '{:?}')",path);
log::error!("read commit.template failed: {e} (path: '{path:?}')");
e
})
.ok()
Expand Down
2 changes: 1 addition & 1 deletion src/popups/create_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl CreateBranchPopup {
));
}
Err(e) => {
log::error!("create branch: {}", e,);
log::error!("create branch: {e}",);
self.queue.push(InternalEvent::ShowErrorMsg(
format!("create branch error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/create_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl CreateRemotePopup {
));
}
Err(e) => {
log::error!("create remote: {}", e,);
log::error!("create remote: {e}",);
self.queue.push(InternalEvent::ShowErrorMsg(
format!("create remote error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl PullPopup {
&self.branch,
);
if let Err(err) = ff_res {
log::trace!("ff failed: {}", err);
log::trace!("ff failed: {err}");
self.confirm_merge(branch_compare.behind);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/popups/rename_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl RenameBranchPopup {
self.queue.push(InternalEvent::SelectBranch);
}
Err(e) => {
log::error!("create branch: {}", e,);
log::error!("create branch: {e}",);
self.queue.push(InternalEvent::ShowErrorMsg(
format!("rename branch error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/rename_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl RenameRemotePopup {
));
}
Err(e) => {
log::error!("rename remote: {}", e,);
log::error!("rename remote: {e}",);
self.queue.push(InternalEvent::ShowErrorMsg(
format!("rename remote error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/tag_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl TagCommitPopup {
self.input.set_text(tag_name);
self.hide();

log::error!("e: {}", e,);
log::error!("e: {e}",);
self.queue.push(InternalEvent::ShowErrorMsg(
format!("tag error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/update_remote_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl UpdateRemoteUrlPopup {
));
}
Err(e) => {
log::error!("update remote url: {}", e,);
log::error!("update remote url: {e}",);
self.queue.push(InternalEvent::ShowErrorMsg(
format!("update remote url error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/revlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl Revlog {
self.search,
LogSearch::Off | LogSearch::Results(_)
) {
log::info!("start search: {:?}", options);
log::info!("start search: {options:?}");

let filter = filter_commit_by_search(
LogFilterSearch::new(options.clone()),
Expand Down
Loading
Loading