-
Notifications
You must be signed in to change notification settings - Fork 40
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
Package reset halted due to encountering local changes #56
Comments
This was included to avoid situations that could lead to uncommitted changes to be wiped when patch commands are used (note that the patch applier logic also triggers when a install/update event targets either directly or indirectly a package that has patches defined against it). The way the patches are applied is based on the standard Composer behaviour of reinstalling a package which would mean that a user can potentially lose changes that they have made to the sub-components and their project, so this error/check has been put in place to avoid such unfortunate situations BUT it could also be caused by the dev-versioned package being targeted by some patch (in which case it'd be actually OK to reinstall it -- but there's no sophisticated logic behind the whole check to differentiate between the two situations). You can force the reset in all such cases by using If you'd want this to be the default behaviour on every composer event that includes patches, you can also add the following to your project's package.json: {
"extra": {
"patcher": {
"force-reset": true
}
}
} |
One thing that could be done here would be to track the fingerprint of the whole code-base of the patched package to determine if changes introduced are from the patches. Another thing that should be checked for is to see if there's a probability for a situation to occur where there are two patches against one dev-version package where first one introduces the code modifications and second one fails. |
From time to time I catch this error while installing composer packages. So what can be a possible reason of this happening? Thanks!
The text was updated successfully, but these errors were encountered: