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

Re: [PATCH 3/3] repository: create read_replace_refs setting

From
Derrick Stolee <derrickstolee@github.com>
Date
Jun 1, 2023, 19:52 UTC
Message-ID
<31962d5e-b14f-86b1-8428-de29650d89ee@github.com>
In-Reply-To
<68fd5ca2-a6c2-d742-5d74-ba93c1497169@github.com>
On 6/1/2023 12:36 PM, Victoria Dye wrote:
> Derrick Stolee via GitGitGadget wrote:
>> From: Derrick Stolee <derrickstolee@github.com>
Show 10 quoted lines
>> Unfortunately, the existing processes that recurse into submodules do
>> not appear to follow object IDs to their contents, so this behavior
>> change is not visible in the current implementation. It is something
>> valuable for future behavior changes.
> 
> AFAIK, the only '--recurse-submodules' commands that recurse in-process are
> 'ls-files' and 'grep'. However, 'grep' does call 'parse_object_or_die()',
> which (further down in the call stack) calls 'lookup_replace_object()'.
> Maybe I'm misreading and the replaced object isn't actually used, but could
> 'git grep --recurse-submodules' be used to test this?

You're right. I was laser-focused on 'ls-files', but it shouldn't be hard to construct an example where 'git grep --recurse-submodules' would show different behavior when this config is toggled.

Show 12 quoted lines
>> +	/*
>> +	 * Do replace refs need to be checked this run?  This variable is
>> +	 * initialized to true unless --no-replace-object is used or
>> +	 * $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
>> +	 * commands that do not want replace references to be active.
>> +	 */
>> +	int read_replace_refs;
> 
> I don't think this comment is accurate anymore, since the repo-scoped
> 'read_replace_refs' value is determined *only* by the 'core.usereplacerefs'
> config. It's 'replace_refs_enabled()' that makes the overall determination
> (taking into account 'GIT_NO_REPLACE_OBJECTS'/'--no-replace-object').
Thank you for catching my mistake here. I'll be sure to update it in v2.

Thanks, -Stolee

Previous: Victoria DyeNext: Elijah Newren
Message 17 of 32 in “Create stronger guard rails on replace refs”
  1. 0/3 Create stronger guard rails on replace refsDerrick Stolee via GitGitGadget, May 26, 2023
  2. 1/3 repository: create disable_replace_refs()Derrick Stolee via GitGitGadget, May 26, 2023
  3. Elijah NewrenMay 31, 2023
  4. Derrick StoleeMay 31, 2023
  5. Jeff KingJun 1, 2023
  6. Junio C HamanoJun 3, 2023
  7. Jeff KingJun 4, 2023
  8. Junio C HamanoJun 1, 2023
  9. Victoria DyeJun 1, 2023
  10. 2/3 replace-objects: create wrapper around settingDerrick Stolee via GitGitGadget, May 26, 2023
  11. Victoria DyeJun 1, 2023
  12. Derrick StoleeJun 1, 2023
  13. Elijah NewrenJun 3, 2023
  14. Derrick StoleeJun 5, 2023
  15. 3/3 repository: create read_replace_refs settingDerrick Stolee via GitGitGadget, May 26, 2023
  16. Victoria DyeJun 1, 2023
  17. Derrick StoleeJun 1, 2023
  18. Elijah NewrenMay 31, 2023
  19. 0/3 Create stronger guard rails on replace refsDerrick Stolee via GitGitGadget, Jun 2, 2023
  20. 1/3 repository: create disable_replace_refs()Derrick Stolee via GitGitGadget, Jun 2, 2023
  21. 2/3 replace-objects: create wrapper around settingDerrick Stolee via GitGitGadget, Jun 2, 2023
  22. René ScharfeJun 3, 2023
  23. Derrick StoleeJun 5, 2023
  24. 3/3 repository: create read_replace_refs settingDerrick Stolee via GitGitGadget, Jun 2, 2023
  25. Victoria DyeJun 5, 2023
  26. Elijah NewrenJun 3, 2023
  27. 0/3 Create stronger guard rails on replace refsDerrick Stolee via GitGitGadget, Jun 6, 2023
  28. 1/3 repository: create disable_replace_refs()Derrick Stolee via GitGitGadget, Jun 6, 2023
  29. 2/3 replace-objects: create wrapper around settingDerrick Stolee via GitGitGadget, Jun 6, 2023
  30. 3/3 repository: create read_replace_refs settingDerrick Stolee via GitGitGadget, Jun 6, 2023
  31. Victoria DyeJun 6, 2023
  32. Junio C HamanoJun 12, 2023

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.