Re: What is in git.git
- From
- Josef Weidendorfer <josef.weidendorfer@gmx.de>
- Date
- Jan 21, 2006, 23:33 UTC
- Message-ID
- <200601220033.26321.Josef.Weidendorfer@gmx.de>
- In-Reply-To
- <7vek31mkyg.fsf@assigned-by-dhcp.cox.net>
On Saturday 21 January 2006 20:37, you wrote:
Show 8 quoted lines
> Alexander Litvinov <lan@ac-sw.com> writes: > >> 1. Can I bind some branch instead of tag (commit) ? > ... > If you mean by "binding a branch", to record how each subproject > relates to the toplevel project (i.e. "the subproject bound to > X/ subdirectory of the toplevel project comes from branch Y"), > that information needs to be somewhere, but recording it in the > commit object goes against the whole git philosophy.
The original gitlink proposal did exactly this: it recorded the place where a subproject is bound by putting a gitlink into a tree. This way, the binding point can be changed, and is subject to versioning itself.
I just realized that this is not currently possible with the bind lines. What about the following usage szenario: - in a superproject, I use a subproject X implementing some lib by binding it at X/. My Makefile recurses into X/ for this. This is recorded at commit point (A) - later on, I realize I need another lib from a probject Y; I want to put the libs X and Y into subdirectory lib/ of my superproject; i.e. I bind Y at lib/Y/ and move the binding point of X to lib/X/. The Makefile is changed accordingly to build the subprojects. This is recorded at commit point (B)
A $GITDIR/bind alone will no work, as moving back to (A) would keep the binding point of subproject, and make is broken.
I understand that "moving binding point of X from X/ to lib/X/" is not representable within the index as a simple change. Is this the main issue for your "against the whole git philosophy"?
I think it still is quite useful to put the binding point into bind lines of the commit. Of course, moving a binding point has to go together with a new commit.
Show 5 quoted lines
> You need to keep a file that describes how your repository is > tracking the development histories of each subproject in > $GIT_DIR/bind, that would look like: > > master main=/ subpro=sub/
What about putting $GITDIR/bind information directly into reference files?
$HOME/gitproj> cat .git/refs/heads/master 92347432598... bind main=/ bind subpro=sub/
This way, you can rename/copy heads, and the binding info will stay with the commit. This also is nice for subprojects that do not need the bind lines, but similar to current cogito subproject proposal:
92347432598... main=/ subpro=sub/
would be the same superproject/subproject configuration without commiting bind lines.
Josef