Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

local-global repositories (composer link command) #601

Open
fprochazka opened this Issue · 9 comments

4 participants

@fprochazka

Hi,
I'm writting simulatenously few libraries and it's realy pain to commit everything and for every few lines write $ composer update. So it would be nice to have new kind of local repository or something, that wouldn't copy the dependency into project, but rather link to it. So when I change something in one project, it affects the other one immediately and I don't have to commit stuff and run update on composer.

Some command like "link this library, but don't touch it, just autoload it".

Or is there any suggested worflow on this problem?

@Seldaek
Owner

There is no way to do it with composer at the moment, obviously you can rm -rf vendor/ and then symlink your repo back at this place manually. This should work as long as you don't update, if you udpate, I'm honestly not sure what can happen. This voids your warranty :)

@fprochazka

I'm pretty sure it wouldn't do anything catastrophic, as long as there are uncommited changes in the repository. I've just bulk replaced something and the IDE replaced it even in the vendor directory. The composer complained than, about the uncommited changes.

I think that is the best behaviour possible! I had my own vendors script inspired by Symfony's vendor script and before this Kdyby/sandbox@3724873 commit, it managed to destroy few days of work :)

So now the question is, could there be added some "create symlink only" respository? I'm not sure if I find time to create a pull request, but I will try.

@Seldaek
Owner

I think the way npm does it (see docs: http://npmjs.org/doc/link.html) sounds pretty awesome. If you can copy that entirely, go for it:)

@Seldaek
Owner

Then the only thing that should be done is that the installers should check if the package dir is a link, and if so they should leave it alone or warn user or something smart, but not delete it and overwrite with something else, and especially not recurse into the symlink and delete everything.

@pavelkucera

I would welcome this type of repository too because of the same reasons as @HosipLan. It's always "type a couple of lines, commit them with message á la 'update', run $ composer update... Oh, there's a typo! So, again..." and that is a way too long for development :).

@Seldaek
Owner

I agree it can be useful, but do you guys realize you can just go in your vendor directory's clone and just develop in there directly? Install with --prefer-source to make sure you get a clone, and then you just go in vendor/foo/bar, and eventually change the git remote with git remote set-url --push origin <your fork url>.

@fprochazka

Well, yes I do, but I find it really paintfull. I tried something like that long ago, when I was using git submodules. It's annoying for so many reasons. I will try to implement the linking into composer and send pull as soon as I can :)

@Seldaek
Owner

Alright, I find it quite practical to work directly in the vendor dir for testing changes easily in my application. That said, I'm happy if you work on a link command either way :)

@dantleech

This would be a nice feature..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.