git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Derrick Stolee <stolee@gmail.com>,
	git@vger.kernel.org, Derrick Stolee <dstolee@microsoft.com>,
	Stefan Beller <sbeller@google.com>
Subject: Re: [PATCH 1/3] check_replace_refs: fix outdated comment
Date: Wed, 18 Jul 2018 15:41:10 -0700	[thread overview]
Message-ID: <xmqqlga8i2ux.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180718204449.GA31816@sigill.intra.peff.net> (Jeff King's message of "Wed, 18 Jul 2018 16:44:49 -0400")

Jeff King <peff@peff.net> writes:

> 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.


> 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;

  reply	other threads:[~2018-07-18 22:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18 20:17 [PATCH] add core.usereplacerefs config option Jeff King
2018-07-18 20:23 ` Derrick Stolee
2018-07-18 20:31   ` Jeff King
2018-07-18 20:37     ` Stefan Beller
2018-07-18 20:44     ` Jeff King
2018-07-18 20:44       ` [PATCH 1/3] check_replace_refs: fix outdated comment Jeff King
2018-07-18 22:41         ` Junio C Hamano [this message]
2018-07-18 22:52           ` Jeff King
2018-07-18 20:45       ` [PATCH 2/3] check_replace_refs: rename to read_replace_refs Jeff King
2018-07-18 22:44         ` Junio C Hamano
2018-07-18 22:53           ` Jeff King
2018-07-18 20:45       ` [PATCH 3/3] add core.usereplacerefs config option Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqlga8i2ux.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=sbeller@google.com \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).