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

ignore: negation with single * wildcard is not applied to directory paths #1203

Open
pmrowla opened this issue Aug 25, 2023 · 0 comments
Open
Labels

Comments

@pmrowla
Copy link
Contributor

pmrowla commented Aug 25, 2023

Related: iterative/dvc#6995

Given this directory structure:

$ tree .
.
└── data
    ├── test
    └── test.dvc

2 directories, 2 files

And this gitignore:

$ cat .gitignore
data/**
!data/*/
!*.dvc

CLI Git only ignores data/test.dvc, but dulwich treats data/ as ignored:

$ git check-ignore data/ data/test.dvc data/test
data/test
$ python -m dulwich check-ignore data/ data/test.dvc data/test
data/
data/test

If you change negation pattern to use a ** wildcard dulwich works as expected:

$ cat .gitignore
data/**
!data/**/
!*.dvc
$ git check-ignore data/ data/test.dvc data/test
data/test
$ python -m dulwich check-ignore data/ data/test.dvc data/test
data/test
@pmrowla pmrowla changed the title ignore: single * wildcard is not applied to directory paths ignore: negation with single * wildcard is not applied to directory paths Aug 25, 2023
@jelmer jelmer added the bug label Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants