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:
commit
9056d3a0b1
3 changed files with 61 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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'")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue