Skip to content

Skip nested git repos when discovering .ruler directories#374

Merged
intellectronica merged 2 commits intomainfrom
codex/fix-issue-373
Feb 5, 2026
Merged

Skip nested git repos when discovering .ruler directories#374
intellectronica merged 2 commits intomainfrom
codex/fix-issue-373

Conversation

@Codex
Copy link
Contributor

@Codex Codex AI commented Feb 5, 2026

Parent repos in nested mode were incorrectly adding .gitignore entries for .ruler paths inside child git repos. Child repos should be isolated and not influence the parent’s ignore list.

  • Traversal guard: findAllRulerDirs now stops descending into subdirectories that contain a .git directory (except the starting root), preventing cross-repo discovery.
  • Coverage: Added a nested git test ensuring only sibling/root .ruler directories are returned when a child repo exists.

Example:

// Parent repo with nested child repo
const dirs = await findAllRulerDirs('/repo');
console.log(dirs);
// Before: ['/repo/sub/.ruler', '/repo/.ruler']
// Now:    ['/repo/.ruler']  // child git repo skipped
Original prompt

Fix #373 according to the plan in #373 (comment)

@Codex Codex AI changed the title [WIP] Fix issue #373 based on provided plan Skip nested git repos when discovering .ruler directories Feb 5, 2026
@Codex Codex AI requested a review from intellectronica February 5, 2026 10:45
@intellectronica intellectronica marked this pull request as ready for review February 5, 2026 11:31
@intellectronica intellectronica merged commit 202c910 into main Feb 5, 2026
2 checks passed
@intellectronica intellectronica deleted the codex/fix-issue-373 branch February 5, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In nested mode, the generated .gitignore lists files in subfolders that are git repos

2 participants