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

Re: Alternates and push

From
JHJan Hudec <bulb@ucw.cz>
Date
Sep 7, 2008, 19:17 UTC
Message-ID
<20080907191740.GA29055@efreet.light.src>
In-Reply-To
<7vhc8rn5sl.fsf@gitster.siamese.dyndns.org>
On Sun, Sep 07, 2008 at 11:56:42 -0700, Junio C Hamano wrote:
Show 32 quoted lines
> Jan Hudec <bulb@ucw.cz> writes:
> 
> > On Sat, Sep 06, 2008 at 11:06:49 -0700, Junio C Hamano wrote:
> >> Theodore Tso <tytso@MIT.EDU> writes:
> >> 
> >> > Long-standing mis-feature in git's logic in deciding what to push.
> >> > It's been reported a few times, but apparently it's hard to fix, or at
> >> > least it never hsa been fixed as far as I know.
> >> 
> >> This comes from an early (mis)design of git.
> >> [...]
> >>  * The existing alternates mechanism is not about alternate repositories.
> >>    It is about alternate object stores.  That is why each line of this
> >>    file points at "objects" directory elsewhere, not the ".git" directory
> >>    that is typically at one level above that "objects" directory.
> >> 
> >>    The fact your repository's object store points at the object store that
> >>    happens to be inside Linus's repository does not imply that Linus's
> >>    object store is associated with refs in Linus's repository in any way
> >>    (that's the early _mis_design part).
> >
> > Why is this a *mis*design? Couldn't push be fixed by redesigning it's
> > protocol along the lines of:
> >  - clients sends a list of sha1s it wants to push, from the tip down
> >  - server stops it when it sees an object it has -- this check can be done
> >    against the object store without having a ref for it.
> 
> Because your second step is *BROKEN*.
> 
> Think of a case where an earlier commit walker started fetching into that
> "server" end, which got newer commits and their associated objects first
> and then older ones, and then got killed before reaching to the objects it

Is there really any transport that stores newer objects first? And can't be fixed to only store the objects when they are good. My proposal definitely does not need to do that (the list goes from newest to older, but the data in third step can come from oldest to newer).

Show 15 quoted lines
> already had.  In such a case, the commit walker will *not* update the refs
> on the server end (and for a very good reason).
> 
> After that, the server end would have:
> 
>  * refs that point at some older commits, all objects from whom are
>    guaranteed to be in the repository (that's the "ref" guarantee);
> 
>  * newer commits and their objects, but if you follow them you will hit
>    some objects that are *NOT* in the repository.
> 
> Now imagine starting your broken procedure to serve clients from such a
> repository.  Your second step would cause the server to attempt to pack
> the difference from the latter classes of incomplete objects and makes the
> pack generation fail.

Yes, it would add a requirement that objects are only placed in the object store after all objects they reference, but I can't imagine good reason this couldn't be done.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 20 in “Alternates and push”
  1. Jon SmirlSep 6, 2008
  2. Theodore TsoSep 6, 2008
  3. Junio C HamanoSep 6, 2008
  4. Jon SmirlSep 6, 2008
  5. Shawn O. PearceSep 6, 2008
  6. Petr BaudisSep 9, 2008
  7. Shawn O. PearceSep 9, 2008
  8. Jan HudecSep 7, 2008
  9. Junio C HamanoSep 7, 2008
  10. Jan HudecSep 7, 2008
  11. Junio C HamanoSep 7, 2008
  12. Jan HudecSep 8, 2008
  13. Theodore TsoSep 7, 2008
  14. Junio C HamanoSep 8, 2008
  15. Theodore TsoSep 8, 2008
  16. Junio C HamanoSep 8, 2008
  17. Junio C HamanoSep 8, 2008
  18. Junio C HamanoSep 8, 2008
  19. Daniel BarkalowSep 8, 2008
  20. Shawn O. PearceSep 8, 2008

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.