From: Junio C Hamano Date: Mon, 12 Dec 2011 19:36:54 GMT Subject: Re: [RFC/PATCH] add update to branch support for "floating submodules" Message-ID: <7vaa6x4m5l.fsf@alter.siamese.dyndns.org> In-Reply-To: Leif Gruenwoldt writes: > On Sat, Dec 10, 2011 at 1:30 AM, Junio C Hamano wrote: > >> So that use case does not sound like a good rationale to require addition >> of floating submodules. > > Ok I will try another scenario :) > > Imagine again products A, B and C and a common library. The products are in > a stable state of development and track a stable branch of the common lib. > Then imagine an important security fix gets made to the common library. On > the next pull of products A, B, and C they get this fix for free > because they were > floating. They didn't need to communicate with the maintainer of the common > repo to know this. In fact they don't really care. They just want the > latest stable > code for that release branch. > > This is how package management on many linux systems works. Dependencies > get updated and all products reap the benefit (or catastrophe) automatically. Distro package dependency tracking is a poor analogy for many reasons, but I'll only touch a few. If you have a common library L and application packages A, B and C, first of all, you do not build distro package of A from the sources of A and L. Instead, package A has a build dependency on package L-devel (in other words, "in order to build A from the source, you need L-devel package installed in your build environment"), build A from its source, link it against L's binary without having the source of L. So the source code arrangement is very different from the typical submodule case, in that you do not even need to have A and L appear in the same working tree, let alone bound in a same superproject as two submodules. A library L may have two API versions, and application A and B may be written for its v1.0 and v2.0 API, respectively. Distro packaging makes the binary package A and B _know_ about their own dependency requirements by recording "A depends on L (v1.0<=,