Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Finder]: GitIgnore unable to exclude a directory and its content #39257

Copy link
Copy link
Closed
@carlalexander

Description

@carlalexander
Issue body actions

Symfony version(s) affected: >=4.4.12

Description

I'm trying to exclude a directory and its content. I have a configuration similar to the one described in #37560. I'm trying to keep all the content in /example/test/.

/example/**
!/example/example.txt
!/example/packages
!/example/packages/example.yaml
!/example/test/

This configuration will only retain the /example/test directory, but not its content. If I try a .gitignore like the one below, PCRE breaks completely:

/example/**
!/example/example.txt
!/example/packages
!/example/packages/example.yaml
!/example/test*

PCRE doesn't handle lookbehind that don't have a fixed length. So the above .gitignore file will cause preg_match(): Compilation failed: lookbehind assertion is not fixed length warnings. This, in turn, causes the whole .gitignore regex to not work and none of the rules get enforced.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.