Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix/Rewrite .gitignore regex builder #40763

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

Merged
merged 1 commit into from
May 9, 2021

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Apr 10, 2021

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets fix #39257
License MIT
Doc PR no

This PR fixes .gitignore with exclude wildcard ignore rules like !a/*/b were failing with preg_match(): Compilation failed: lookbehind assertion is not fixed length at offset PHP error.

Functionality/performance was verified against large .gitignore files:

This PR also improves the testing cases.

@carsonbot
Copy link

Hey!

To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done?

Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review.

Cheers!

Carsonbot

@mvorisek mvorisek changed the title WIP Fix wildcard gitignore WIP Fix gitignore regex generator for exclude rules with wildcard Apr 10, 2021
@mvorisek mvorisek closed this Apr 10, 2021
@mvorisek mvorisek changed the title WIP Fix gitignore regex generator for exclude rules with wildcard WIP Rewrite gitignore regex generator Apr 11, 2021
@mvorisek mvorisek changed the title WIP Rewrite gitignore regex generator WIP Fix/Rewrite gitignore regex builder Apr 11, 2021
@mvorisek mvorisek changed the title WIP Fix/Rewrite gitignore regex builder Fix/Rewrite gitignore regex builder Apr 11, 2021
@mvorisek mvorisek changed the title Fix/Rewrite gitignore regex builder Fix/Rewrite .gitignore regex builder Apr 11, 2021
@mvorisek mvorisek reopened this Apr 11, 2021
@mvorisek mvorisek force-pushed the fix_wildcard_gitignore branch 2 times, most recently from 0e4daff to cbc233d Compare April 11, 2021 11:42
@mvorisek mvorisek marked this pull request as ready for review April 11, 2021 11:42
@carsonbot carsonbot added this to the 4.4 milestone Apr 11, 2021
@mvorisek mvorisek changed the title Fix/Rewrite .gitignore regex builder [Finder] Fix/Rewrite .gitignore regex builder Apr 11, 2021
@mvorisek mvorisek force-pushed the fix_wildcard_gitignore branch 2 times, most recently from bd5de06 to d530c6d Compare April 11, 2021 12:00
@mvorisek mvorisek force-pushed the fix_wildcard_gitignore branch from e102f96 to 883450e Compare April 11, 2021 12:33
@carsonbot
Copy link

Hey!

I think @hurricane-voronin has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@mvorisek mvorisek force-pushed the fix_wildcard_gitignore branch 5 times, most recently from e859ae5 to 31c3f57 Compare April 12, 2021 11:43
@mvorisek mvorisek requested a review from jderusse April 12, 2021 11:43
@Jeroeny
Copy link
Contributor

Jeroeny commented Apr 13, 2021

With .gitignore:

/config/**
!/config/packages
!/config/packages/something.yaml

It seems to give an invalid result:
given: config/packages/foo.yaml
actual: git-ignored
regex result: 0 (no match, not git-ignored)

@mvorisek mvorisek force-pushed the fix_wildcard_gitignore branch from d5232c4 to a3d89b6 Compare April 13, 2021 10:45
@mvorisek mvorisek force-pushed the fix_wildcard_gitignore branch 6 times, most recently from 8d1b903 to 5a7f2a5 Compare April 13, 2021 13:07
@mvorisek
Copy link
Contributor Author

mvorisek commented Apr 13, 2021

@Jeroeny /config/** rule was wrongly "canceled" by !/config/packages rule. Now fixed in 13179f8.

@mvorisek mvorisek requested a review from stof April 13, 2021 13:11
@mvorisek mvorisek force-pushed the fix_wildcard_gitignore branch 2 times, most recently from a6f61eb to 331be37 Compare April 16, 2021 07:35
@mvorisek
Copy link
Contributor Author

mvorisek commented May 7, 2021

This PR is hanging here for 3 weeks, AppVeyor build error is irrelevant, can someone please review it?

@carsonbot carsonbot changed the title [Finder] Fix/Rewrite .gitignore regex builder Fix/Rewrite .gitignore regex builder May 9, 2021
@fabpot fabpot force-pushed the fix_wildcard_gitignore branch from 331be37 to 83f9fd3 Compare May 9, 2021 09:13
@fabpot
Copy link
Member

fabpot commented May 9, 2021

Thank you @mvorisek.

@fabpot fabpot merged commit be480d8 into symfony:4.4 May 9, 2021
@mvorisek mvorisek deleted the fix_wildcard_gitignore branch May 9, 2021 09:18
This was referenced May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants