Composer dependency with attached sorce control repository - version-control

I have an app that uses some of our own libraries as dependencies. Let's say vendor/me/somelib is such a dependency. When working on the main app, often times I am also changing the somelib dependency. I am using Mercurial for VCS of somelib.
Is there a way that when composer initializes the dependency, it initializes it as a VCS (Mercurial) repo so that when changing somelib I can then easily push changes to the main somelib repo? Or is there some other way to achieve the same need (to easily propagate changes in a dependency back to its main repo).

Related

What should we upload/push to Github repository when we are working with Electron?

I'm working with a Electron project, and now I want to push it to my Github repository, but I don't know what file I should push. Can any body tell me what file should I push?
You can push any files you wish…
You will probably not want to push your IDE settings directory, perhaps unless you are the only person working on your application. Of course, when you make changes to any of your IDE settings, they will be reflected in your GIT status and require pushing as well if not ignored.
Most people do not push their node_modules folder due to the sheer size and frequency of updates it often receives. That said, there is talk that pushing your node_modules folder will prevent future issues should a package maintainer pull a package from NPM that you depend upon.
Lastly, I do not include my build or dist directories as these are quite large, contain binaries and are not really that useful until your final release, after which you will normally distribute it on a platform such as an app store, your own website or update server (or Github).

GitHub, composer, autoupdate of standalone repositories

I have a main repository which is core router for mine system modules.
So every module is a standalone repository also.
How can I make that pushing to main repository will fire event to push the updated code to standalone repository?
Just as like https://github.com/Sylius/Sylius - they have main repository (this link) in which they collect pull-requests and standalone repositories like https://github.com/Sylius/SyliusTaxonomyBundle which exists in src/Sylius/Bundle/TaxonomyBundle
Don't they manually push the updates to standalone repos? Or some kind of github hooks? git subtree?
And why they do have the "replace" section in composer.json? How does this works? I didn't get an idea from official documentation :((
Sylius (and Symfony) create separate repositories for their components and bundle so that they can be used independently with composer. They only work in a single repository and use subtree to split the components and bundle into read only repositories.
I don't believe they are technically read-only, this is just an easier workflow than having to pull changes from the subrepo's in every time.
They probably use something like Git Subsplit GitHub WebHook to automatically update the subrepo's.
Using they replace key means that Sylius/Sylius contains Sylius/SyliusCartBundle in its self.
So when using a project which uses Sylius/Sylius and Sylius/SyliusCartBundle, Composer knows not to download Sylius/SyliusCartBundle because it is already provided by Sylius/Sylius.

Packagist: "create-project" from fork loads original repo

I'm just trying to grasp the concepts of dependency managers and GIT systems, so it's very possible I'm missing something very basic.
I use ROOTS/BEDROCK project as a base of my Wordpress projects. It allows to use Composer with Wordpress (by adding Wordpress itself as a dependency) and various other awesome features. It is installable as a Packagist package by command composer create-project roots/bedrock.
However to make it fit with my Wordpress framework, I needed to do a light customization of the project. So I forked it and submited the fork to http://packagist.org with entirely new composer.json file.
What I do not understand is why composer after command composer create-project myaccount/forked_bedrock installs original repository and not my fork.
TL;DR
Is it possible to submit a forked GitHub repository to Packagist and use the fork (not the original repo) by create-project command?
Thanks in advance!
It seems that the problem lied within Composer cache - after I've cleared it, Composer loaded the forked GitHub repository (not the original).
If Composer caches so "heavily", it would be nice if there was some option to clear/flush the cache, but apparently there is nothing built-in ...
in my case was that i had to change the name of the package in the composer.json, changing the "name" propierty f

Am I using EGit and Eclipse correctly when working with repositories?

I'm trying to set up EGit with Eclipse and I've used neither of them before. I understand the basics around Git and Eclipse is more or less just another IDE. The problem I'm having is setting up a reasonable work environment.
I have file-server at home which I want to use as a Bare repository which I push and pull changes to. To test it out I've done the setup locally.
I have a bare repository created through the Git Repository perspective.
I've cloned that repository into a local non-bare repository.
I've created a project in a subdir of the non-bare repository (is this the way to go? Is it possible to do have the project directly in the workspace with the .git folder within it? So far I've had a lot of trouble with it when trying to create an Eclipse project out of it. What is the proper way to do it?)
I've made some changes to this cloned repository and added the indexes, committed the changes and attempted to push the changes to upstream.
The thing is that no changes are made to upstream. Would someone like to explain the procedure in doing the push so that I'm not misunderstanding something? Or am I completely wrong on utilizing a bare repository instead of just working non-bare?
As mentioned in this tutorial, you create your Git repo right where your project is (ie your .classpath and .project files are).
Pushing to a bare repo is a good idea (see the links mentioned in "Git - pull & push - production server")
You need though to specify what you want to push:
Click at least on "Add all branch spec".

How to use Eclipse and versioning for a matrix of projects

Our company develop several software products, which reuse each others packages (we use Java). Every product represented as separate Eclipse Java project and has it's own versioning repository (we use Mercurial).
When we find a bug in some shared package, we need to transfer changes to all consuming projects, and this is a hell. The key problem is that Eclipse project can be associated only with one versioning repository.
Could someone recommend some way to associate Eclipse Java project whith several versioning repositories which in ideal may be geterogeious (svn, git, mercurial) ?
This should really be addressed with:
git submodules or
mercurial SubRepos
You can modify directly from a submodule/subrepo, push to a "central" repo, and other can fetch the modifications, and then go one directory up (in the main repo referencing all the other submodules) in order to register the new commit of the new submodule/subrepo state.
The "main project" (the main repo which record all the other submodules/subrepos states) is not necessary an Eclipse project (one of the submodules can be the main Eclipse project, with project dependencies on other).
See "true nature of submodules" for more on that process, which remains "not easy", but can still be managed precisely.