git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What is in git.git

From
JWJosef 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 14 in “What is in git.git”
  1. Junio C HamanoJan 21, 2006
  2. Alexander LitvinovJan 21, 2006
  3. Junio C HamanoJan 21, 2006
  4. Junio C HamanoJan 21, 2006
  5. Josef WeidendorferJan 21, 2006
  6. Junio C HamanoJan 22, 2006
  7. Josef WeidendorferJan 24, 2006
  8. Petr BaudisJan 22, 2006
  9. Daniel BarkalowJan 22, 2006
  10. Junio C HamanoJan 22, 2006
  11. Daniel BarkalowJan 22, 2006
  12. Junio C HamanoJan 22, 2006
  13. Junio C HamanoJan 22, 2006
  14. Alexander LitvinovJan 21, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.