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

Re: [PATCH v2] sha1-file: remove OBJECT_INFO_SKIP_CACHED

From
Jeff King <peff@peff.net>
Date
Jan 6, 2020, 21:17 UTC
Message-ID
<20200106211730.GB980197@coredump.intra.peff.net>
In-Reply-To
<20200104001331.GA130883@google.com>
On Fri, Jan 03, 2020 at 04:13:31PM -0800, Jonathan Nieder wrote:
Show 21 quoted lines
> To follow up on Junio's hint in his review: callers can inject
> additional cached objects by using pretend_object_file.  Junio
> described how this would make sense as a mechanism for building
> the virtual ancestor object, but we don't do that.  In fact, the
> only caller is fake_working_tree_commit in "git blame", a read-only
> code path. *phew*
> 
> -- >8 --
> Subject: sha1-file: document how to use pretend_object_file
> [...]
> +/*
> + * Add an object file to the in-memory object store, without writing it
> + * to disk.
> + *
> + * Callers are responsible for calling write_object_file to record the
> + * object in persistent storage before writing any other new objects
> + * that reference it.
> + */
>  int pretend_object_file(void *, unsigned long, enum object_type,
>  			struct object_id *oid);
>  

I think this is an improvement over the status quo, but it's still a potential trap for code which happens to run in the same process (see my other email in the thread).

Should the message perhaps be even more scary?
-Peff
Previous: Jonathan NiederNext: Jonathan Nieder
Message 11 of 13 in “sha1-file: remove OBJECT_INFO_SKIP_CACHED”
  1. sha1-file: remove OBJECT_INFO_SKIP_CACHEDJonathan Tan, Dec 30, 2019
  2. Junio C HamanoDec 30, 2019
  3. Jonathan NiederDec 30, 2019
  4. Jonathan TanDec 31, 2019
  5. Jonathan NiederDec 31, 2019
  6. sha1-file: remove OBJECT_INFO_SKIP_CACHEDJonathan Tan, Jan 2, 2020
  7. sha1-file: remove OBJECT_INFO_SKIP_CACHEDJonathan Tan, Jan 2, 2020
  8. Junio C HamanoJan 2, 2020
  9. Jeff KingJan 6, 2020
  10. Jonathan NiederJan 4, 2020
  11. Jeff KingJan 6, 2020
  12. Jonathan NiederJan 6, 2020
  13. Jeff KingJan 7, 2020

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.