Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer: Develop directly in vendor packages

I have a PHP project where I use composer.

My own main library is actually a required package, as I'm also building a "standalone version" for people to install (not just the library), thus it lands in the vendor directory.

Most of the time I spend developing the project happens in that vendor package, which is a Git clone already, however not on any branch. I can change that quickly enough by running git checkout master. However, every time I run composer update, it either complains about the directory being dirty, or checks out a new copy, where I have to start without being on a branch once more.

So, my question: is there some mode for Composer to e.g. only fetch the changes in that repo? Or what would be the preferred way to develop (or just contribute to) a vendor package at the same time as developing the main package?

like image 786
Franz Avatar asked Sep 27 '12 15:09

Franz


1 Answers

As of a couple minutes ago composer updates will now ask you whether you want to revert the changes or do a stash/apply before/after the package update. This should help quite a bit with such problems, see https://github.com/composer/composer/pull/1188 for details.

like image 113
Seldaek Avatar answered Oct 05 '22 07:10

Seldaek