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

Re: [PATCH 3/4] replace-objects: evaluate replacement refs without using the object store

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Sep 13, 2017, 08:03 UTC
Message-ID
<fe956802-41ab-783f-62b3-f7c4b8292e8c@alum.mit.edu>
In-Reply-To
<20170912173140.GD144745@aiede.mtv.corp.google.com>
On 09/12/2017 07:31 PM, Jonathan Nieder wrote:
Show 16 quoted lines
> From: Stefan Beller <sbeller@google.com>
> 
> Pass DO_FOR_EACH_INCLUDE_BROKEN when iterating over replacement refs
> so that the iteration does not require opening the named objects from
> the object store. This avoids a dependency cycle between object access
> and replace ref iteration.
> 
> Moreover the ref subsystem has not been migrated yet to access the
> object store via passed in repository objects.  As a result, without
> this patch, iterating over replace refs in a repository other than
> the_repository it produces errors:
> 
>    error: refs/replace/3afabef75c627b894cccc3bcae86837abc7c32fe does not point to a valid object!
> 
> Noticed while adapting the object store (and in particular its
> evaluation of replace refs) to handle arbitrary repositories.

Have you checked that consumers of this API can handle broken references? Aside from missing values, broken references can have illegal names (though hopefully not unsafe in the sense of causing filesystem traversal outside of `$GITDIR`).

Michael
Previous: Jonathan NiederNext: Jeff King
Message 7 of 12 in “Fixes from the per-repository object store series”
  1. 0/4 Fixes from the per-repository object store seriesJonathan Nieder, Sep 12, 2017
  2. 1/4 pack: make packed_git_mru global a value instead of a pointerJonathan Nieder, Sep 12, 2017
  3. 2/4 push, fetch: error out for submodule entries not pointing to commitsJonathan Nieder, Sep 12, 2017
  4. Heiko VoigtSep 14, 2017
  5. Brandon WilliamsSep 18, 2017
  6. 3/4 replace-objects: evaluate replacement refs without using the object storeJonathan Nieder, Sep 12, 2017
  7. Michael HaggertySep 13, 2017
  8. Jeff KingSep 13, 2017
  9. 4/4 packed refs: pass .git dir instead of packed-refs path to init_fnJonathan Nieder, Sep 12, 2017
  10. Michael HaggertySep 13, 2017
  11. Richard MawSep 13, 2017
  12. Junio C HamanoSep 15, 2017

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.