Add new patcher: git 'init' patcher #471
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
git
has historically been the most reliable mechanism for applying patches. Unfortunately, it doesn't work at all when the target directory isn't a git repo. This pull request adds a new patcher that creates a fake (minimal) git repository in the target directory, uses git to apply the patch, and then cleans up the fake git repo.Related tasks
Other notes
@deviantintegral I'm very curious about your thoughts on this one since you did most of the original debugging around why
git
was misbehaving. (composer install
then./vendor/bin/codecept run tests/acceptance/ApplyGitPatchFromWebUsingInitCept.php --debug
if you want to play with this locally) -- I merged #472 but we can revert if needed.If this approach works, I'm really considering #472 as a path forward. Git handles a lot of things that people have asked for over the year. It's also a lot easier to support -- "Go install
git
" is easier to communicate than "Go installpatch
... no, thepatch
that came with your system is unusable and you need to install this other thing that is named exactly the same but provides different functionality"