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

Re: [PATCH 1/3] check_replace_refs: fix outdated comment

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2018, 22:41 UTC
Message-ID
<xmqqlga8i2ux.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180718204449.GA31816@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> Commit afc711b8e1 (rename read_replace_refs to
> check_replace_refs, 2014-02-18) added a comment mentioning
> that check_replace_refs is set in two ways:
>
>   - from user intent via --no-replace-objects, etc
>
>   - after seeing there are no replace refs to respect
>
> Since c3c36d7de2 (replace-object: check_replace_refs is safe
> in multi repo environment, 2018-04-11) the second is no
> longer true. Let's drop that part of the comment.
>

I wonder if c3c36d7de2 should be corrected so that we would have this bit per in-core repository instance? When the superproject and its three submodules all have an in-core repository instance each, and only one of the submodules uses replace ref, the original optimization disabled by that patch would be an obvious thing to have per repository.

But that is a tangent. What this patch does is correct without any doubt.

Show 20 quoted lines
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  cache.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/cache.h b/cache.h
> index d49092d94d..6365fd6c0f 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -804,9 +804,7 @@ void reset_shared_repository(void);
>   * 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.  As an
> - * optimization it is also set to false if replace references have
> - * been sought but there were none.
> + * commands that do not want replace references to be active.
>   */
>  extern int check_replace_refs;
>  extern char *git_replace_ref_base;
Previous: Jeff KingNext: Jeff King
Message 7 of 12 in “add core.usereplacerefs config option”
  1. add core.usereplacerefs config optionJeff King, Jul 18, 2018
  2. Derrick StoleeJul 18, 2018
  3. Jeff KingJul 18, 2018
  4. Stefan BellerJul 18, 2018
  5. Jeff KingJul 18, 2018
  6. 1/3 check_replace_refs: fix outdated commentJeff King, Jul 18, 2018
  7. Junio C HamanoJul 18, 2018
  8. Jeff KingJul 18, 2018
  9. 2/3 check_replace_refs: rename to read_replace_refsJeff King, Jul 18, 2018
  10. Junio C HamanoJul 18, 2018
  11. Jeff KingJul 18, 2018
  12. 3/3 add core.usereplacerefs config optionJeff King, Jul 18, 2018

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.