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

.gitignore ** rules not consistent with regular git syntax #1641

Closed
NomarCub opened this issue Sep 7, 2022 · 7 comments
Closed

.gitignore ** rules not consistent with regular git syntax #1641

NomarCub opened this issue Sep 7, 2022 · 7 comments

Comments

@NomarCub
Copy link

NomarCub commented Sep 7, 2022

folder/other-folder/**/**js does not ignore folder/other-folder/dir/main.js.
Double asterisks should be interpreted here as two asterisks, which match anything - see https://git-scm.com/docs/gitignore#_pattern_format

I am using isogit in a plugin to the Obsidian note-taking app on Android. The issue came up there: denolehov/obsidian-git#297

@Vinzent03
Copy link

Double asterisks should be interpreted here as two one asterisks

@NomarCub
Copy link
Author

NomarCub commented Sep 7, 2022

The doc says this:

Other consecutive asterisks are considered regular asterisks

So I think it really is two asterisks.

@jcubic
Copy link
Contributor

jcubic commented Sep 8, 2022

@NomarCub Since you need to feature maybe you want to do the fix? This project is driven by contributors. I'm a maintainer but I don't write code myself for this project. And there is no primary author, that will do all the hard work.

@NomarCub
Copy link
Author

NomarCub commented Sep 8, 2022

I kinda have a lot on my plate now, but I might take a look eventually.
I made this issue not so much because I need a fix very badly, but more to confirm and inform devs and users alike that this discrepancy exists, because I would have liked to know this info earlier when I went Googling about this.

@ar-nelson
Copy link

isomorphic-git uses ignore (https://github.com/kaelzhang/node-ignore) to parse .gitignore files and determine which files to ignore, so this is actually a bug in ignore.

@mojavelinux
Copy link
Contributor

Thanks for pointing that out. It also looks it has been reported (or at least a variation of this case): kaelzhang/node-ignore#57

@NomarCub
Copy link
Author

I have no means to verify for my examples anymore, but apparently this has been solved in node-ignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants