zed-industries/zed · error

View commit failed

Error message

View commit failed

What it means

Sentinel failure in the commit-log/show flow: the `git show` future completed but the surrounding result was Err, so opening CommitView for the selected commit failed (git show failed or the commit could not be parsed).

Solutions

  1. Refresh the git log — the commit may have been removed by a rebase/reset
  2. Verify the commit exists with `git show <sha>` in the terminal
  3. Check repository health: `git fsck` can detect a corrupted object store
  4. Re-fetch if the commit is on a remote: `git fetch --all`
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/git_ui/src/git_ui.rs:692 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/5cb864adf562f73a. Report an issue: GitHub.

Appendix: source

Thrown at crates/git_ui/src/git_ui.rs:692

                let show_result = show_future.await;

                match show_result {
                    Ok(Ok(details)) => {
                        workspace.update_in(cx, |workspace, window, cx| {
                            CommitView::open(
                                details.sha.to_string(),
                                repo.downgrade(),
                                workspace.weak_handle(),
                                None,
                                None,
                                window,
                                cx,
                            );
                        })?;
                    }
                    Ok(Err(_)) | Err(_) => {
                        workspace.update(cx, |workspace, cx| {
                            let error = anyhow::anyhow!("View commit failed");
                            Self::show_git_error_toast(&git_ref_string, error, workspace, cx);
                        });
                    }
                }

                Ok(())
            })
            .detach();
        cx.emit(DismissEvent);
    }

    fn show_git_error_toast(
        _git_ref: &str,
        error: anyhow::Error,
        workspace: &mut Workspace,
        cx: &mut Context<Workspace>,
    ) {
        let toast = Toast::new(NotificationId::unique::<()>(), error.to_string());

View on GitHub (pinned to f4178619ac)