From 59bc2cd059c28f6699b290d0c038f83a1e756c53 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 29 Dec 2025 14:52:13 -0800 Subject: [PATCH] fix: remove gitignore negations that override fork protection (#796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The negation patterns (!issues.jsonl, !interactions.jsonl, etc.) in .beads/.gitignore had higher precedence than the fork protection exclusion in .git/info/exclude, effectively defeating fork protection. Contributors could accidentally stage and commit upstream issue databases because: 1. Fork protection added .beads/issues.jsonl to .git/info/exclude 2. .beads/.gitignore had !issues.jsonl which overrode the exclusion 3. .gitignore files have higher precedence than .git/info/exclude The negation patterns were unnecessary anyway since no pattern in .beads/.gitignore matches those files. Added a comment explaining why negations should not be added. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .beads/.gitignore | 10 +++++----- cmd/bd/doctor/gitignore.go | 10 +++++----- cmd/bd/init_test.go | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.beads/.gitignore b/.beads/.gitignore index 96620144..e68d2a20 100644 --- a/.beads/.gitignore +++ b/.beads/.gitignore @@ -27,8 +27,8 @@ beads.left.meta.json beads.right.jsonl beads.right.meta.json -# Keep JSONL exports and config (source of truth for git) -!issues.jsonl -!interactions.jsonl -!metadata.json -!config.json +# 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. +# The JSONL files (issues.jsonl, interactions.jsonl) and config files +# are tracked by git by default since no pattern above ignores them. diff --git a/cmd/bd/doctor/gitignore.go b/cmd/bd/doctor/gitignore.go index 8b141e9d..676447d8 100644 --- a/cmd/bd/doctor/gitignore.go +++ b/cmd/bd/doctor/gitignore.go @@ -36,11 +36,11 @@ beads.left.meta.json beads.right.jsonl beads.right.meta.json -# Keep JSONL exports and config (source of truth for git) -!issues.jsonl -!interactions.jsonl -!metadata.json -!config.json +# 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. +# The JSONL files (issues.jsonl, interactions.jsonl) and config files +# are tracked by git by default since no pattern above ignores them. ` // requiredPatterns are patterns that MUST be in .beads/.gitignore diff --git a/cmd/bd/init_test.go b/cmd/bd/init_test.go index 4f81122e..e3de68a1 100644 --- a/cmd/bd/init_test.go +++ b/cmd/bd/init_test.go @@ -129,7 +129,7 @@ func TestInitCommand(t *testing.T) { "beads.base.jsonl", "beads.left.jsonl", "beads.right.jsonl", - "!issues.jsonl", + "Do NOT add negation patterns", // Comment explaining fork protection } for _, pattern := range expectedPatterns { if !strings.Contains(gitignoreStr, pattern) {