From 251456cf20887b91e0ba2d507b47ace14d4c24ff Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Wed, 20 May 2026 17:41:33 -0400 Subject: [PATCH] Add some debug logging to understand hangs in the git store's `compute_snapshot` (#57317) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- crates/project/src/git_store.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rs index ee6063c0e4e..ad5174ec365 100644 --- a/crates/project/src/git_store.rs +++ b/crates/project/src/git_store.rs @@ -9144,6 +9144,8 @@ async fn compute_snapshot( backend: Arc, cx: &mut AsyncApp, ) -> Result { + log::debug!("starting compute snapshot"); + let (id, work_directory_abs_path, prev_snapshot) = this.update(cx, |this, _| { this.paths_needing_status_update.clear(); ( @@ -9175,6 +9177,7 @@ async fn compute_snapshot( } }) .await?; + log::debug!("fetched branches, head commit, worktrees"); let branch = branches.iter().find(|branch| branch.is_head).cloned(); let branch_list: Arc<[Branch]> = branches.into(); @@ -9198,6 +9201,8 @@ async fn compute_snapshot( }) .await?; + log::debug!("fetched remotes"); + let snapshot = this.update(cx, |this, cx| { let head_changed = branch != this.snapshot.branch || head_commit != this.snapshot.head_commit; @@ -9257,6 +9262,7 @@ async fn compute_snapshot( } }) .await?; + log::debug!("fetched statuses, diff stats, stash entries"); let diff_stat_map: HashMap<&RepoPath, DiffStat> = diff_stats.entries.iter().map(|(p, s)| (p, *s)).collect();