Skip to content

Feature Request: make ignore globbing patterns more intuitive for directories #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
daverayment opened this issue Mar 29, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@daverayment
Copy link

Hi,

Let's say I have the following repomix command, which both includes and excludes files:

repomix
    --include "MyProject.Common/**/*,MyProject.Models/**/*,MyProject.UI/**/*"
    --ignore "**/bin,**/obj,**/GeneratedFiles,**/Assets"

That is the correct syntax. However, if I amend the exclusion patterns to include trailing slashes, it does not work:

repomix
    --include "MyProject.Common/**/*,MyProject.Models/**/*,MyProject.UI/**/*"
    --ignore "**/bin/,**/obj/,**/GeneratedFiles/,**/Assets/"

The result of running this is that all files are still included in the folders we've marked to ignore. It is reasonable to assume that **/Assets and **/Assets/ would mark all Assets folders under the include paths for exclusion.

Similarly, the following command will not work either:

repomix
    --include "MyProject.Common/**/*,MyProject.Models/**/*,MyProject.UI/**/*"
    --ignore "**/bin/**/*,**/obj/**/*,**/GeneratedFiles/**/*,**/Assets/**/*"

This uses the same globbing pattern to attempt to exclude files as it does to include files, but no files are excluded.

This caught me out today when using the tool for the first time.

In summary, please make the following --ignore patterns perform identically:

**/folder
**/folder/
**/folder/**/*

Incidentally, the "**/name" syntax for exclusion patterns may be problematic, as it will match both folders and files with that name. It's rare that you have files lacking extensions, of course, but it may be worth noting.

Thank you for your useful tool!

@yamadashy
Copy link
Owner

Hi, @daverayment !
Sorry for the delayed response.
Thank you for your suggestion!

You're right, this behavior differs somewhat from common glob behavior in other tools, which can lead to confusion.

I'm currently reviewing a PR from @pranshugupta01 that addresses this issue along with #450.

@yamadashy yamadashy added the enhancement New feature or request label Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@yamadashy @daverayment and others