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

Implement new ** glob semantics per Git #1098

Closed
okdana opened this issue Nov 1, 2018 · 2 comments
Closed

Implement new ** glob semantics per Git #1098

okdana opened this issue Nov 1, 2018 · 2 comments

Comments

@okdana
Copy link
Contributor

okdana commented Nov 1, 2018

Hey! Looks like the new ** glob semantics discussed on the Git mailing list have been merged:

git/git@627186d

(Just to reiterate, the change makes a ** used in any context other than **/, /**/, or /** act as two regular *s.)

I believe this change will appear not in the up-coming release (2.20), but the one right after that.

I'd been playing with globset in preparation for this landing, which is how i discovered the issues i mentioned in #1093, but i'm not happy with my changes, so i don't have a PR yet. I was also unsure whether you'd want to wait until this actually appears in a released Git or what. But i wanted to make a note of it, anyway, just to track it.

@okdana
Copy link
Contributor Author

okdana commented Dec 10, 2018

I was wrong about when this would come out. It's in 2.20, released today: http://lkml.iu.edu/hypermail/linux/kernel/1812.1/00293.html

And the updated documentation is live: https://git-scm.com/docs/gitignore

The difference in behaviour can be confirmed with e.g. git ls-files in the ripgrep repo:

% ~cellar/git/2.19.2/bin/git ls-files --ignored -x '/**.md'
# (no output)
% ~cellar/git/2.20.0/bin/git ls-files --ignored -x '/**.md'
CHANGELOG.md
FAQ.md
GUIDE.md
ISSUE_TEMPLATE.md
README.md

(We'd already established this, but just to be clear, Git did actually accept ** in many cases where it said it didn't, so some documented-illegal patterns, like [A-Z]**.md, won't demonstrate any difference)

@BurntSushi
Copy link
Owner

Awesome! I'm happy to see the ** issue finally moving towards a solid answer. :-)

Sorry I haven't addressed this sooner or your PR yet. Everything looks good, and thanks for all the legwork on this. From what I've skimmed, everything sounds right, but I haven't quite gotten the time to sink my teeth into the details yet.

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

2 participants