Description
When starting Deep Code in a directory that is not a git repository (and has no parent git repo), git outputs the following warning to stderr:
fatal: not a git repository (or any of the parent directories): .git
This happens every time Deep Code is launched or a new session is started in a non-git directory.
Cause
Deep Code likely runs git rev-parse --show-toplevel (or similar) at startup to detect the project root directory. When no .git directory exists anywhere in the path, git itself emits this fatal error to stderr.
Expected behavior
Deep Code should either:
- Suppress git stderr when probing for the repo root (e.g., redirect stderr to
/dev/null), or
- Use a fallback approach that does not depend on
git (e.g., using process.cwd() directly when git fails), or
- At minimum, silently handle the case where no git repo is present instead of leaking the raw git error to the user.
Steps to reproduce
- Create a directory with no
.git subdirectory and no parent git repo
- Run
deepcode in that directory
- Observe the
fatal: not a git repository message
Environment
- Deep Code CLI v0.1.34
- macOS (likely reproducible on all platforms)
Additional context
This is purely cosmetic — Deep Code still functions correctly afterwards. However, the error message is confusing to users who may not be using git at all, and it clutters the terminal output unnecessarily.
Description
When starting Deep Code in a directory that is not a git repository (and has no parent git repo), git outputs the following warning to stderr:
This happens every time Deep Code is launched or a new session is started in a non-git directory.
Cause
Deep Code likely runs
git rev-parse --show-toplevel(or similar) at startup to detect the project root directory. When no.gitdirectory exists anywhere in the path, git itself emits this fatal error to stderr.Expected behavior
Deep Code should either:
/dev/null), orgit(e.g., usingprocess.cwd()directly when git fails), orSteps to reproduce
.gitsubdirectory and no parent git repodeepcodein that directoryfatal: not a git repositorymessageEnvironment
Additional context
This is purely cosmetic — Deep Code still functions correctly afterwards. However, the error message is confusing to users who may not be using git at all, and it clutters the terminal output unnecessarily.