fix: remove gitignore negations that override fork protection (#796)
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 <noreply@anthropic.com>
This commit is contained in:
10
.beads/.gitignore
vendored
10
.beads/.gitignore
vendored
@@ -27,8 +27,8 @@ beads.left.meta.json
|
|||||||
beads.right.jsonl
|
beads.right.jsonl
|
||||||
beads.right.meta.json
|
beads.right.meta.json
|
||||||
|
|
||||||
# Keep JSONL exports and config (source of truth for git)
|
# NOTE: Do NOT add negation patterns (e.g., !issues.jsonl) here.
|
||||||
!issues.jsonl
|
# They would override fork protection in .git/info/exclude, allowing
|
||||||
!interactions.jsonl
|
# contributors to accidentally commit upstream issue databases.
|
||||||
!metadata.json
|
# The JSONL files (issues.jsonl, interactions.jsonl) and config files
|
||||||
!config.json
|
# are tracked by git by default since no pattern above ignores them.
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ beads.left.meta.json
|
|||||||
beads.right.jsonl
|
beads.right.jsonl
|
||||||
beads.right.meta.json
|
beads.right.meta.json
|
||||||
|
|
||||||
# Keep JSONL exports and config (source of truth for git)
|
# NOTE: Do NOT add negation patterns (e.g., !issues.jsonl) here.
|
||||||
!issues.jsonl
|
# They would override fork protection in .git/info/exclude, allowing
|
||||||
!interactions.jsonl
|
# contributors to accidentally commit upstream issue databases.
|
||||||
!metadata.json
|
# The JSONL files (issues.jsonl, interactions.jsonl) and config files
|
||||||
!config.json
|
# are tracked by git by default since no pattern above ignores them.
|
||||||
`
|
`
|
||||||
|
|
||||||
// requiredPatterns are patterns that MUST be in .beads/.gitignore
|
// requiredPatterns are patterns that MUST be in .beads/.gitignore
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ func TestInitCommand(t *testing.T) {
|
|||||||
"beads.base.jsonl",
|
"beads.base.jsonl",
|
||||||
"beads.left.jsonl",
|
"beads.left.jsonl",
|
||||||
"beads.right.jsonl",
|
"beads.right.jsonl",
|
||||||
"!issues.jsonl",
|
"Do NOT add negation patterns", // Comment explaining fork protection
|
||||||
}
|
}
|
||||||
for _, pattern := range expectedPatterns {
|
for _, pattern := range expectedPatterns {
|
||||||
if !strings.Contains(gitignoreStr, pattern) {
|
if !strings.Contains(gitignoreStr, pattern) {
|
||||||
|
|||||||
Reference in New Issue
Block a user