Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork960
feat: Add support for hasconfig git rule.#2075
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat: Add support for hasconfig git rule.#2075
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks so much for contributing this capability!
I really like the implementation, and love that there are tests as well.
To my mind these tests cover the most important cases.
Good to merge!
elifkeyword=="hasconfig:remote.*.url": | ||
forremoteinself._repo.remotes: | ||
iffnmatch.fnmatchcase(remote.url,value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Using a case-sensitive search is correct here, Git does the same.
# Ensure that config with hasconfig and incorrect url is incorrect. | ||
withopen(path1,"w")asstream: | ||
stream.write(template.format("incorrect",path2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think that "incorrect" fails to communicate that this is a URL that simply doesn't match.
Maybe something for a follow-up.
0c2bfac
intogitpython-developers:mainUh oh!
There was an error while loading.Please reload this page.
Oh, such speed, thanks for the quick response! |
Support adding custom paths for the following git config:
According to the documentation:
So I have matched the condition exactly word to word with
hasconfig:remote.*.url
. I then go over the list of remotes and find usingfnmatchcase
the correct remote (not sure iffnmatch
.Maybe a list of open points here:
Closes#2017