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

Re: [PATCH] Fix "unpack-objects --strict"

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2009, 06:32 UTC
Message-ID
<7vocqiucpw.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090814060307.GA31721@auto.tuwien.ac.at>
Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:
Show 5 quoted lines
> To introduce a object with one of its linked objects missing, left it
> out of the pack and push it into the repository. unpack-objects will
> unpack all objects and fail updating the ref (but leave all objects in
> the repository). As second step, simply send a ref update request,
> which should succed, as the object is present in the repository.

Your "ref update request" exploit does not work because your understanding of how we decide to allow updating a ref is flawed.

We do not blindly update a ref to a commit only because we happen to have that commit. We require that commit to reach existing tips of refs without break. The logic is in quickfetch() in builtin-fetch.c.

This stronger validation is necessary to deal with any failed transfer by http walkers, so it is nothing unusual nor new. They walk from the latest commits that exist on the other side, and their object transfer can be interrupted before they transfer enough older commits to make the history connected with what we already had. In such a case we obviously do not update any ref. And when we re-run the same request, we do not say "Ah, we have the tip in the object database, so we will update the ref to it".

That is why I said requiring connectivity is a good idea, but keeping them in core is a misguided waste of memory.

Previous: Martin KoeglerNext: Martin Koegler
Message 5 of 9 in “[BUG] Submodules problem with subdirectories and pushing”
  1. Frank LichtenheldAug 13, 2009
  2. Frank LichtenheldAug 13, 2009
  3. Fix "unpack-objects --strict"Junio C Hamano, Aug 13, 2009
  4. Martin KoeglerAug 14, 2009
  5. Junio C HamanoAug 14, 2009
  6. Martin KoeglerAug 14, 2009
  7. Junio C HamanoAug 14, 2009
  8. Junio C HamanoAug 14, 2009
  9. Frank LichtenheldAug 14, 2009

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.