Skip to content
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

common path algorithm calculates parts wrong with / inside part #79

Open
jxn-30 opened this issue Dec 13, 2024 · 2 comments
Open

common path algorithm calculates parts wrong with / inside part #79

jxn-30 opened this issue Dec 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jxn-30
Copy link

jxn-30 commented Dec 13, 2024

Given a nested file structure:

Click me to open file tree
.
├── a
│   ├── e
│   │   ├── h
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── i
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── j
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── n.txt
│   │   ├── o.txt
│   │   └── p.txt
│   ├── f
│   │   ├── h
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── i
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── j
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── n.txt
│   │   ├── o.txt
│   │   └── p.txt
│   ├── g
│   │   ├── h
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── i
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── j
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── n.txt
│   │   ├── o.txt
│   │   └── p.txt
│   ├── q.txt
│   ├── r.txt
│   └── s.txt
├── b
│   ├── e
│   │   ├── h
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── i
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── j
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── n.txt
│   │   ├── o.txt
│   │   └── p.txt
│   ├── f
│   │   ├── h
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── i
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── j
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── n.txt
│   │   ├── o.txt
│   │   └── p.txt
│   ├── g
│   │   ├── h
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── i
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── j
│   │   │   ├── k.txt
│   │   │   ├── l.txt
│   │   │   └── m.txt
│   │   ├── n.txt
│   │   ├── o.txt
│   │   └── p.txt
│   ├── q.txt
│   ├── r.txt
│   └── s.txt

When running the glob ./{a/e,b/f}/{n,o,k}.txt, I expect to match the files ./a/e/n.txt, ./a/e/o.txt, ./b/f/n.txt, ./b/f/o.txt. tinyglobby however does not match any files.
When running the glob ./{a/e,b/f,**/*}/{n,o,k}.txt, I expect to match a total of 30 files. tinyglobby however does not match any files.

I've created a minimal reproduction example in https://github.com/jxn-30/tinyglobby-brace-expansion that shows how tinyglobby differs from fast-glob/globby at this point.
Glob tester also shows how minimatch produces the same result as fast-glob/globby.

@SuperchupuDev
Copy link
Owner

interesting 🤔, will debug and try to fix

@SuperchupuDev
Copy link
Owner

the fix is simple, however there is a bug (currently only present on main) that needs to be fixed first. thanks for reporting!

@SuperchupuDev SuperchupuDev added the bug Something isn't working label Dec 18, 2024
@SuperchupuDev SuperchupuDev changed the title [BUG]: tinyglobby ignores / in brace expansion common path algorithm calculates parts wrong with / inside part Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants