Source Control Graph: commit diffs fail in multi-repo (Zephyr/west) workspaces — git runs in wrong cwd

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Category: Bug Reports · Tags: git, source-control, wsl, monorepo

Clicking a commit in the built-in Source Control Graph fails to load its diff when the opened workspace folder isn’t itself a git repo but contains repos in sub-folders — the standard Zephyr / west layout. The Graph runs its git show in the workspace-root directory instead of the repo that owns the commit.

Error shown:

Failed to load commit: Command failed: git show -m --pretty=format:<…>
fatal: not a git repository (or any of the parent directories): .git

Steps to Reproduce

Make a folder that is not a git repo (no .git).
Put one or more git repos in sub-folders (e.g. board-ace/, stella-common/).
Open the top (non-repo) folder in Cursor.
Ensure the sub-repos show in Source Control (git.autoRepositoryDetection: true).
Open Graph → click any commit in a sub-repo.

Expected Behavior

the commit’s changed files/diffs load. Actual: the error above; no diff.

Root cause (verified from CLI)
The same command the Graph runs reproduces the error from the workspace root, but works inside the repo — so git and the data are fine; only the working directory is wrong:

from workspace root (non-repo):

$ git show -m --pretty=format:‘%H’
fatal: not a git repository (or any of the parent directories): .git

from inside the repo:

$ git -C board-ace show -m --pretty=format:‘%H’
# works
Scope & things that don’t fix it
Hits any multi-repo workspace whose root isn’t a repo; Zephyr/west is the canonical case (the west topdir is deliberately a non-repo folder containing many sub-repos).
git.repositoryScanMaxDepth / git.scanRepositories make the repos appear in Source Control but don’t fix the diff — the bug is the cwd for git show, not detection.
A multi-root .code-workspace did not help when the first folder was the non-repo root, suggesting the Graph derives cwd from the workspace/first folder rather than the selected repository.
Suggested fix & workarounds
Fix: resolve the cwd for the Graph’s git show/history commands from the selected repository’s root, not the workspace folder.

Workarounds:

Built-in Timeline view (per-file; resolves the correct repo).
Terminal: git -C show .
Open the individual repo as its own single-folder window (Graph then works).
A couple of forum tips when you paste it in:

Put the Title line’s text in the Discourse title field (drop the Title: label), and set the category/tags from the UI rather than the text lines.
Discourse renders

as collapsible on the published post (not always in the live preview pane) — so don’t worry if the preview looks flat.

Operating System

Other

Version Information

Cursor 3.24.9
WSL2 (Linux 6.x, microsoft-standard-WSL2), Ubuntu
git 2.34.1
No git-related extensions (reproduced with built-in git only)

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @KenDi,

This is a known issue, and I’ve added your report to it. It’s fixed in Cursor 3.25 and later: clicking a commit in the Graph now runs git in the repository that owns the commit, including when the opened folder is a parent that isn’t a repo itself. You’re on 3.24.9, so updating to the latest version (3.27) should clear it.