fix(multi-get): support brace expansion patterns in glob matching#424
Open
antonio-mello-ai wants to merge 1 commit intotobi:mainfrom
Open
fix(multi-get): support brace expansion patterns in glob matching#424antonio-mello-ai wants to merge 1 commit intotobi:mainfrom
antonio-mello-ai wants to merge 1 commit intotobi:mainfrom
Conversation
Brace expansion patterns like `{doc1,doc2}.md` or `collection/{a,b}.md`
were incorrectly parsed as comma-separated file lists instead of being
passed to the glob matcher (picomatch). This happened because the
comma-detection heuristic only checked for `*` and `?` but not `{`.
Also adds `collection/path` matching in `matchFilesByGlob` so patterns
like `my-collection/{file1,file2}.md` work — previously the glob only
matched against `qmd://collection/path` (virtual) and `path` (relative
to collection root), missing the `collection/path` form.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Friendly ping — this has been open for ~2 weeks. CI is green, 4 new tests passing. Happy to address any feedback. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{doc1,doc2}.mdorcollection/{a,b}.mdwere incorrectly parsed as comma-separated file lists instead of being passed to the glob matcher (picomatch). The comma-detection heuristic checked for*and?but not{, so any pattern containing{a,b}was split on the comma and treated as two separate file lookups.matchFilesByGlobonly matched againstqmd://collection/path(virtual path) andpath(relative to collection root), but notcollection/path— so glob patterns prefixed with a collection name never matched anything.Changes
src/store.ts(findDocuments): Add!pattern.includes('{')to theisCommaSeparatedcheck so brace patterns route to picomatchsrc/cli/qmd.ts(multiGet): Same fix for the CLI code pathsrc/store.ts(matchFilesByGlob): Addcollection/pathas a third matching target alongsidevirtual_pathandpathtest/store.test.ts: 4 new tests covering brace expansion, collection-prefixed brace patterns, and collection/path glob matchingTest plan
🤖 Generated with Claude Code