Composer - immutable changes (symfony 2.1)

I am using symfony 2.1 with composer and I am trying to start composer update

However, I continue to receive β€œuncommitted changes” , I don’t remember to change any files in the suppliers directory, and it appears in almost every package!

I tried the installation linker to undo any changes, but it does not seem to have an effect. If I delete the lock file and try to install , I get error messages like "symfony 2.1 requires symfony 2.1 -> symfony 2.1 is doable". It just doesn't make sense.

If I delete the content in the providers, I get the same error messages and installs nothing.

None of what I seem to be working. Is there a way to update using "force" regardless of "uncommitted changes"

+6
source share
3 answers

You can use composer status -v . Here you can detect a file change in vendor/ with this command and how to fix it.

First, we verify that the package is not modified:

 ➜ SymfonyApp git:(master) βœ— composer status No local changes 

Then we change the provider file

 ➜ SymfonyApp git:(master) βœ— echo "modification" >> vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php 

Then we ask the composer to tell us about the modified files of the providers (pay attention to the -v option to view the modified files)

 ➜ SymfonyApp git:(master) βœ— composer status -v You have changes in the following dependencies: /Users/adrienbrault/Developer/SymfonyApp/vendor/symfony/symfony: M src/Symfony/Component/HttpKernel/Kernel.php 

Then we create a reset git provider repository to restore the files to their original state.

 ➜ SymfonyApp git:(master) βœ— cd /Users/adrienbrault/Developer/SymfonyApp/vendor/symfony/symfony ➜ symfony git checkout . ➜ symfony cd - ~/Developer/SymfonyApp 

Finally, we verify that the files are no longer considered modified by the composer.

 ➜ SymfonyApp git:(master) βœ— composer status -v No local changes 

Update: Now the composer will help you deal with this.

+14
source

Since this affected different projects related to dependencies on the same server, because, for example, the author-developer asked me to test the quick changes before submitting errors and fixing their repo, I ran this to globally set the reset-changes to true :

 php composer.phar config -g discard-changes 1 
+2
source

You can also set discard-changes to true in the configuration parameter of your composer.json file, see https://getcomposer.org/doc/06-config.md#discard-changes .

 { "name": "test", "description": "Demonstrating concepts", ... "config": { "process-timeout": 1800, "discard-changes" : true }, ... } 
+2
source

Source: https://habr.com/ru/post/925284/


All Articles