Conversation
`normalizeGlobPattern` rewrites every `**/`-prefixed pattern without an inner `/**`, which turns `**/npm-debug.log*` into `**/npm-debug.log*/**` — a rule that only matches paths below a match, so the files it names are never ignored. Five built-in default ignores are inert this way, including `**/repomix-output.*`, so a committed previous pack gets embedded in the next one. The rewrite is documented and commented as the directory case (`**/folder`), so skip it when the last segment already ends with a wildcard. That only affects rules that currently match nothing.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: yamadashy/repomix/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: yamadashy/repomix/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
ChangesIgnore Pattern Fix
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #1876
Five built-in default ignore rules end in a bare wildcard (
**/npm-debug.log*,**/yarn-debug.log*,**/yarn-error.log*,**/repomix-output.*,**/repopack-output.*) and none of them ignores anything today, becausenormalizeGlobPatternappends/**to every**/-prefixed pattern that has no inner/**.**/npm-debug.log*becomes**/npm-debug.log*/**, which in fast-glob matches only paths below a match — so the file the rule names can never be matched by it.Visible effect on a pristine build of
9f01703a, packing a fixture that contains the files those rules name:The
repomix-outputpair is the one that bites hardest: a repository with a committed previous pack anywhere in it embeds that pack into the new one, which is what those two lines exist to prevent.It is not limited to the default list — any user pattern in that shape is inert, while the two neighbouring shapes work:
-i**/probe-xyz*probe-xyz***/probe-xyz.old1The change
The rewrite is scoped to directories by its own JSDoc ("Makes
**/folder,**/folder/, and**/folder/**/*behave identically") and by the comment above it, but the guard only tests the prefix. This adds the missing shape test, so it fires only for rules that currently match nothing:Verified against globby's own matcher rather than inferred: of the 86 default patterns 32 take this branch, and exactly the 5 above lose every match under it —
**/node_modules/**-style directory rules and**/folder-style rules are untouched, which is why the failure is easy to miss.After the change the same fixture packs
src/a.ts,.gitignore,probe-xyz.old1,README.mdonly, and-i '**/probe-xyz*'now excludes the probe file. The new test pins the three built-in shapes; the existing**/bin/**/nested/folder/**/folder/**cases still assert the directory rewrite unchanged.Deliberately out of scope:
--split-outputwritesout.1.xml… besideout.xml, andgetIgnorePatternsonly adds the base output path, so a second split run re-packs the first run's parts. Different rule, different line — worth its own issue.Checklist
npm run testnpm run lint