Skip to content

Commit

Permalink
Improve the clarity of performance logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 29, 2024
1 parent da1283e commit ffb067a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/gitbutler-branch-actions/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ impl VirtualBranchActions {
branch::move_commit(&ctx, target_branch_id, commit_oid).map_err(Into::into)
}

#[instrument(level = tracing::Level::DEBUG, skip(self, project), err(Debug))]
pub fn create_virtual_branch_from_branch(
&self,
project: &Project,
Expand Down
2 changes: 2 additions & 0 deletions crates/gitbutler-branch-actions/src/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ use std::{
fmt::Debug,
vec,
};
use tracing::instrument;

#[instrument(level = tracing::Level::DEBUG, skip(ctx, _permission))]
pub(crate) fn get_uncommited_files_raw(
ctx: &CommandContext,
_permission: &WorktreeReadPermission,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use gitbutler_oplog::SnapshotExt;
use gitbutler_project::access::WorktreeWritePermission;
use gitbutler_reference::{normalize_branch_name, ReferenceName, Refname};
use gitbutler_repo::{RepoActionsExt, RepositoryExt};
use tracing::instrument;

use super::BranchManager;
use crate::{
Expand All @@ -19,6 +20,7 @@ use crate::{

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

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

impl BranchManager<'_> {
#[instrument(level = tracing::Level::DEBUG, skip(self, vbranch), err(Debug))]
fn build_real_branch(&self, vbranch: &mut Branch) -> Result<git2::Branch<'_>> {
let repo = self.ctx.repository();
let target_commit = repo.find_commit(vbranch.head)?;
Expand Down
1 change: 1 addition & 0 deletions crates/gitbutler-branch-actions/src/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ fn write_integration_file(head: &git2::Reference, path: PathBuf) -> Result<()> {
std::fs::write(path, format!(":{}", sha))?;
Ok(())
}
#[instrument(level = tracing::Level::DEBUG, skip(vb_state, ctx), err(Debug))]
pub fn update_gitbutler_integration(
vb_state: &VirtualBranchesHandle,
ctx: &CommandContext,
Expand Down

0 comments on commit ffb067a

Please sign in to comment.