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

Fix include patterns in .griveignore #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

callegar
Copy link

@callegar callegar commented Nov 9, 2018

Hi, this is an attempt at fixing include patterns in .griveignore following the discussion in bug #208.

Basically, the patch assures that include patterns are converted into lookahead patterns terminated by $ in the regular expression used to sift the filenames.

In this way if you have an include pattern (e.g., database), this only matches database rather than database and anything below it (as it is currently and incorrectly the case).

If you want to include database and anything below, then you should have !database** in your .griveignore.

The patch also assures that the regular expression is printed when one asks for a verbose output, so that some debugging is possible.

@segatrade
Copy link

Why it's not merged yet?(

@vitalif
Copy link
Owner

vitalif commented Jun 3, 2022

Are you sure that negated gitignore patterns should not affect directories?

For example when I run

git init .
mkdir database
touch database/a
echo database >> .gitignore
echo '!database' >> .gitignore
git status

git status shows me database/ as an untracked directory rather than ignored. It doesn't require database**

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

Successfully merging this pull request may close these issues.

4 participants