Summary
Currently, CodeGraph generates .codegraph/.gitignore like this:
This ignores all files inside .codegraph/, but intentionally keeps .codegraph/.gitignore visible to Git.
That behavior makes sense when a project wants to commit this file and share the CodeGraph ignore rule with the whole team. However, in many cases CodeGraph is only used by one developer locally. In that scenario, keeping .codegraph/.gitignore unignored creates an extra untracked file:
As a result, the user has to either commit a CodeGraph-specific file, manually edit the generated .gitignore, or manually add .codegraph/ to the project root .gitignore.
Problem
For users who treat CodeGraph as a local-only indexing/cache tool, the generated .codegraph/.gitignore can be slightly intrusive.
The current generated content:
means .codegraph/.gitignore itself appears in git status unless it is committed.
That creates a few drawbacks:
- It requires an extra commit just to silence
git status.
- It adds a
.codegraph/.gitignore file to the repository, even if other teammates do not use CodeGraph.
- For projects where CodeGraph is only used by one developer, the committed
.codegraph/ directory can look unexpected or unnecessary.
- Users may prefer CodeGraph's database and metadata to remain entirely local, with no repository footprint at all.
Proposal
Could CodeGraph support one of the following options?
Option 1: Generate only * in .codegraph/.gitignore
Instead of generating:
generate:
This would cause .codegraph/.gitignore to ignore itself as well, making the entire .codegraph/ directory local-only and invisible to git status.
Option 2: Add an init option
For example:
codegraph init --local-only
or:
codegraph init --ignore-self
When this option is used, CodeGraph could generate:
instead of:
The current behavior could remain the default for users who want to commit .codegraph/.gitignore and share the ignore rule with the repository.
Expected behavior
When using the proposed local-only mode:
codegraph init --local-only
CodeGraph would generate this file:
Then git status would not show .codegraph/ at all.
Expected result:
.codegraph/ never appears in git status
no extra commit is needed
no CodeGraph-specific file appears in the repository
teammates who do not use CodeGraph are not affected
Current workaround
Users can manually replace:
with:
or add this to the project root .gitignore:
However, it would be nicer if CodeGraph supported this directly during initialization.
Why this would help
The current behavior is useful for projects that want to commit a repository-level CodeGraph ignore rule.
A local-only option would make CodeGraph less intrusive for individual developers who only want a local cache/index and do not want any CodeGraph-specific files to appear in the repository.
Summary
Currently, CodeGraph generates
.codegraph/.gitignorelike this:This ignores all files inside
.codegraph/, but intentionally keeps.codegraph/.gitignorevisible to Git.That behavior makes sense when a project wants to commit this file and share the CodeGraph ignore rule with the whole team. However, in many cases CodeGraph is only used by one developer locally. In that scenario, keeping
.codegraph/.gitignoreunignored creates an extra untracked file:As a result, the user has to either commit a CodeGraph-specific file, manually edit the generated
.gitignore, or manually add.codegraph/to the project root.gitignore.Problem
For users who treat CodeGraph as a local-only indexing/cache tool, the generated
.codegraph/.gitignorecan be slightly intrusive.The current generated content:
means
.codegraph/.gitignoreitself appears ingit statusunless it is committed.That creates a few drawbacks:
git status..codegraph/.gitignorefile to the repository, even if other teammates do not use CodeGraph..codegraph/directory can look unexpected or unnecessary.Proposal
Could CodeGraph support one of the following options?
Option 1: Generate only
*in.codegraph/.gitignoreInstead of generating:
generate:
*This would cause
.codegraph/.gitignoreto ignore itself as well, making the entire.codegraph/directory local-only and invisible togit status.Option 2: Add an init option
For example:
or:
When this option is used, CodeGraph could generate:
*instead of:
The current behavior could remain the default for users who want to commit
.codegraph/.gitignoreand share the ignore rule with the repository.Expected behavior
When using the proposed local-only mode:
CodeGraph would generate this file:
*Then
git statuswould not show.codegraph/at all.Expected result:
Current workaround
Users can manually replace:
with:
*or add this to the project root
.gitignore:.codegraph/However, it would be nicer if CodeGraph supported this directly during initialization.
Why this would help
The current behavior is useful for projects that want to commit a repository-level CodeGraph ignore rule.
A local-only option would make CodeGraph less intrusive for individual developers who only want a local cache/index and do not want any CodeGraph-specific files to appear in the repository.