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
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