Merge pull request #1714 from peterkc/fix/gitignore-dolt-entries

fix(doctor): add dolt/ and dolt-access.lock to GitignoreTemplate
This commit is contained in:
Steve Yegge 2026-02-14 11:03:01 -08:00 • committed by GitHub
commit 9056d3a0b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 61 additions and 0 deletions

View file

@ -54,6 +54,10 @@ beads.right.meta.json
sync_base.jsonl
export-state/
# Dolt database (managed by Dolt remotes, not git)
dolt/
dolt-access.lock
# NOTE: Do NOT add negation patterns (e.g., !issues.jsonl) here.
# They would override fork protection in .git/info/exclude, allowing
# contributors to accidentally commit upstream issue databases.
@ -76,6 +80,8 @@ var requiredPatterns = []string{
".jsonl.lock",
"sync_base.jsonl",
"export-state/",
"dolt/",
"dolt-access.lock",
}
// CheckGitignore checks if .beads/.gitignore is up to date

View file

@ -1674,3 +1674,49 @@ func TestRequiredPatterns_ContainsJSONLLock(t *testing.T) {
t.Error("requiredPatterns should include '.jsonl.lock'")
}
}
// TestGitignoreTemplate_ContainsDolt verifies that the .beads/.gitignore template
// includes dolt/ to prevent the Dolt database directory from being committed.
func TestGitignoreTemplate_ContainsDolt(t *testing.T) {
if !strings.Contains(GitignoreTemplate, "dolt/") {
t.Error("GitignoreTemplate should contain 'dolt/' pattern")
}
}
// TestGitignoreTemplate_ContainsDoltAccessLock verifies that the .beads/.gitignore template
// includes dolt-access.lock to prevent the Dolt advisory lock file from being committed.
func TestGitignoreTemplate_ContainsDoltAccessLock(t *testing.T) {
if !strings.Contains(GitignoreTemplate, "dolt-access.lock") {
t.Error("GitignoreTemplate should contain 'dolt-access.lock' pattern")
}
}
// TestRequiredPatterns_ContainsDolt verifies that bd doctor validates
// the presence of the dolt/ pattern in .beads/.gitignore.
func TestRequiredPatterns_ContainsDolt(t *testing.T) {
found := false
for _, pattern := range requiredPatterns {
if pattern == "dolt/" {
found = true
break
}
}
if !found {
t.Error("requiredPatterns should include 'dolt/'")
}
}
// TestRequiredPatterns_ContainsDoltAccessLock verifies that bd doctor validates
// the presence of the dolt-access.lock pattern in .beads/.gitignore.
func TestRequiredPatterns_ContainsDoltAccessLock(t *testing.T) {
found := false
for _, pattern := range requiredPatterns {
if pattern == "dolt-access.lock" {
found = true
break
}
}
if !found {
t.Error("requiredPatterns should include 'dolt-access.lock'")
}
}

View file

@ -194,6 +194,15 @@ bd import issues.jsonl
## Troubleshooting
### Already Committed dolt/ to Git
If you committed `.beads/dolt/` before this fix:
1. Update gitignore: `bd doctor --fix`
2. Remove from git tracking: `git rm --cached -r .beads/dolt/ .beads/dolt-access.lock`
3. Commit the removal: `git commit -m "fix: remove accidentally committed dolt data"`
4. To purge from history (optional): use [BFG Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/) or `git filter-repo`
### Server Won't Start
```bash