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

Re: What is in git.git

From
Junio C Hamano <junkio@cox.net>
Date
Jan 22, 2006, 02:44 UTC
Message-ID
<7v64odj821.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200601220033.26321.Josef.Weidendorfer@gmx.de>
Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:
Show 15 quoted lines
> 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)

The original gitlink proposal records commit object name in the link object itself, so do bind lines in the commit object in bound commit proposal. In either way, you need to deal with the subproject relocation at the Porcelain level.

I was hoping that, upon seeing these two commits (let's say we are dealing with two-way merge aka "checkout"):

	In commit 1:
		bind xxxxx... X/
	In commit 2:
		bind yyyyy... lib/X/
                bind zzzzz... lib/Y/

the tool could notice that xxxxx... and yyyyy... are related in their ancestry chain, detect the relocation of subprojects, and update the $GIT_DIR/bind file (maybe with some help from the end user). We can do something similar in gitlink approach as well.

> A $GITDIR/bind alone will no work, as moving back to (A) would keep
> the binding point of subproject, and make is broken.

I do not see why. $GIT_DIR/bind can be adjusted by the tool upon checkout to reflect the reorganized tree.

Show 6 quoted lines
> What about putting $GITDIR/bind information directly into reference files?
>
>  $HOME/gitproj> cat .git/refs/heads/master
>  92347432598...
>  bind main=/
>  bind subpro=sub/

I think that would also work. Although I do not immediately see major difference in expressiveness either way, that may be a cleaner way to achieve what we want to do.

Previous: Josef WeidendorferNext: Josef Weidendorfer
Message 6 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.