-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add require-git option #6923
base: master
Are you sure you want to change the base?
Add require-git option #6923
Conversation
The code changes loog good but this needs documentation in |
Done! I broke the convention of the book being the same as the comments in the code, though, because this one has the less intuitive property that it enables a new feature when set to false rather than true. |
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.
LGTM
Does this need to be an option? Why not just turn this on by default? |
Having an on-by-default behavior that invisibly uses the global gitignore to decide what files to hide from you seems pretty opaque to me. It might lead to confusion. Maybe ideally there are fully separate settings for global/local? This might be a slightly bigger change, but definitely doable. |
It's not doable with ignore sadly. You would need to reimplement the git detection yourself |
Yes, I agree - though if we could then use ignore to actually do the parsing and filesystem walk, I think it would just be a function that steps up the directory tree looking for .git directories. Still, rolling our own git detection does feel like it's a little bit out of scope, and I think the behavior we have (whether or not to force git-like behavior regardless of git status) is pretty straightforward for users. |
This pull request resolves the issue #6909 so it should probably be properly linked to it. |
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.
Looks ready to ship
Adds a
require-git
config option to the file picker and uses it to determine whether theignore::WalkBuilder
requires the current directory to be a git directory or not.Closes #6909