Skip to content

Fix include patterns in .griveignore#238

Open
callegar wants to merge 1 commit intovitalif:masterfrom
callegar:fix_include_pattern
Open

Fix include patterns in .griveignore#238
callegar wants to merge 1 commit intovitalif:masterfrom
callegar:fix_include_pattern

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