Skip to content

Commit ffb067a

Browse files
committed
Improve the clarity of performance logs
1 parent da1283e commit ffb067a

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

crates/gitbutler-branch-actions/src/actions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ impl VirtualBranchActions {
570570
branch::move_commit(&ctx, target_branch_id, commit_oid).map_err(Into::into)
571571
}
572572

573+
#[instrument(level = tracing::Level::DEBUG, skip(self, project), err(Debug))]
573574
pub fn create_virtual_branch_from_branch(
574575
&self,
575576
project: &Project,

crates/gitbutler-branch-actions/src/branch.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ use std::{
2424
fmt::Debug,
2525
vec,
2626
};
27+
use tracing::instrument;
2728

29+
#[instrument(level = tracing::Level::DEBUG, skip(ctx, _permission))]
2830
pub(crate) fn get_uncommited_files_raw(
2931
ctx: &CommandContext,
3032
_permission: &WorktreeReadPermission,

crates/gitbutler-branch-actions/src/branch_manager/branch_removal.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use gitbutler_oplog::SnapshotExt;
88
use gitbutler_project::access::WorktreeWritePermission;
99
use gitbutler_reference::{normalize_branch_name, ReferenceName, Refname};
1010
use gitbutler_repo::{RepoActionsExt, RepositoryExt};
11+
use tracing::instrument;
1112

1213
use super::BranchManager;
1314
use crate::{
@@ -19,6 +20,7 @@ use crate::{
1920

2021
impl BranchManager<'_> {
2122
// to unapply a branch, we need to write the current tree out, then remove those file changes from the wd
23+
#[instrument(level = tracing::Level::DEBUG, skip(self, perm), err(Debug))]
2224
pub fn convert_to_real_branch(
2325
&self,
2426
branch_id: BranchId,
@@ -52,6 +54,7 @@ impl BranchManager<'_> {
5254
real_branch.reference_name()
5355
}
5456

57+
#[instrument(level = tracing::Level::DEBUG, skip(self, perm), err(Debug))]
5558
pub(crate) fn delete_branch(
5659
&self,
5760
branch_id: BranchId,
@@ -128,6 +131,7 @@ impl BranchManager<'_> {
128131
}
129132

130133
impl BranchManager<'_> {
134+
#[instrument(level = tracing::Level::DEBUG, skip(self, vbranch), err(Debug))]
131135
fn build_real_branch(&self, vbranch: &mut Branch) -> Result<git2::Branch<'_>> {
132136
let repo = self.ctx.repository();
133137
let target_commit = repo.find_commit(vbranch.head)?;

crates/gitbutler-branch-actions/src/integration.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ fn write_integration_file(head: &git2::Reference, path: PathBuf) -> Result<()> {
122122
std::fs::write(path, format!(":{}", sha))?;
123123
Ok(())
124124
}
125+
#[instrument(level = tracing::Level::DEBUG, skip(vb_state, ctx), err(Debug))]
125126
pub fn update_gitbutler_integration(
126127
vb_state: &VirtualBranchesHandle,
127128
ctx: &CommandContext,

0 commit comments

Comments
 (0)