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

Re: Notes on Subproject Support

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jan 23, 2006, 16:31 UTC
Message-ID
<Pine.LNX.4.64.0601231116550.25300@iabervon.org>
In-Reply-To
<7v7j8r7e7s.fsf@assigned-by-dhcp.cox.net>
On Sun, 22 Jan 2006, Junio C Hamano wrote:
Show 24 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> >> Switching branches
> >> ------------------
> >> 
> >> Along with the traditional two-way merge by `read-tree -m -u`,
> >> we would need to look at:
> >> 
> >> . `bind` lines in the current `HEAD` commit.
> >> 
> >> . `bind` lines in the commit we are switching to.
> >> 
> >> . subproject binding information in the index file.
> >> 
> >> to make sure we do sensible things.
> >
> > This is one place I think storing the bindings in the commit is awkward. 
> > read-tree deals in trees (hence the name), but will need information from 
> > the commit.
> 
> That's why it is 'along with'.  Dealing with binding information
> can be done between commits and index without bothering tree
> objects.  read-tree would not have to deal with it, and I think
> keeping it that way is probably a good idea.

I think it would be a lot more fragile if switching branches requires multiple programs interacting with the index file. If things get interrupted after the tree is read but before the bindings are changed, the user will probably generate an inconsistant commit or have to deal with figuring out what's going on. It is a nice property of the current system that the index file never exists under the usual filename without being consistant.

Show 8 quoted lines
> In other words, I think the design so far does not require us to
> touch tree objects at all, and I'd be happy if we do not have to.
>
> One reason I started the bound commit approach was exactly
> because I only needed to muck with commit objects and did not
> have to touch trees and blobs; after trying to implement the
> core level for "gitlink", which I ended up touching quite a lot
> and have abandoned for now.

I think that the same thing that worked with the index file would work for minimizing the impact of the changes as far as the code sees. If the struct tree parser reported the tree at a path when it found a commit at a path, it would work just as if the original tree had used trees (like in your proposal).

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 15 in “Notes on Subproject Support”
  1. Junio C HamanoJan 23, 2006
  2. Daniel BarkalowJan 23, 2006
  3. Junio C HamanoJan 23, 2006
  4. Junio C HamanoJan 23, 2006
  5. Alexander LitvinovJan 23, 2006
  6. Daniel BarkalowJan 23, 2006
  7. Junio C HamanoJan 23, 2006
  8. Daniel BarkalowJan 23, 2006
  9. Junio C HamanoJan 24, 2006
  10. Daniel BarkalowJan 23, 2006
  11. Junio C HamanoJan 24, 2006
  12. Daniel BarkalowJan 24, 2006
  13. Junio C HamanoJan 23, 2006
  14. Martin AtukundaJan 23, 2006
  15. Junio C HamanoJan 23, 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.