list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Tan <>
Subject: Re: [PATCH v3] fetch: no FETCH_HEAD display if --no-write-fetch-head
Date: Thu,  3 Sep 2020 14:06:28 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

> Jonathan Tan <> writes:
> > OK - updated the code, added a test for the "--dry-run
> > --no-write-fetch-head" case, and updated commit message and code
> > comment.
> Unfortunately our actions crossed X-< and the previous one that was
> good enough is already in 'master', together with the lazy fetch
> topic.
> Let's turn this into an incremental fix only for "Ouch, we still say
> FETCH_HEAD when both --dry-run and --no-write-fetch-head are given"
> bug.
> Thanks.
> -- >8 --
> Subject: [PATCH] fetch: fix --dry-run --no-write-fetch-head interaction
> From: Jonathan Tan <>
> Recently we introduced "--[no-]-write-fetch-head" option to tell
> "git fetch" not to write FETCH_HEAD file.  The command reported that
> FETCH_HEAD file is written, even with the "--no-write-fetch-head"
> option.
> db3c293e (fetch: no FETCH_HEAD display if --no-write-fetch-head,
> 2020-09-02) tried to squelch this, but the fix was not sufficient.
> Because we never write the FETCH_HEAD file when "--dry-run" is
> given, the addition of "--[no-]write-fetch-head" option was made by
> directly fliping the internal variable 'write_fetch_head' (which
> defaults to 'on') to 'off' upon seeing "--dry-run", which allowed
> the condition to decide if we write FETCH_HEAD to be a simple
> reference to the variable.  But now, we need to tell if the user
> explicitly asked "--no-write-fetch-head" with "--dry-run" to
> decide when to show the report about FETCH_HEAD correctly.
> Introduce an extra 'user_specified_write_fetch_head' variable, which
> is 'on' by default and is turned 'off' with '--no-write-fetch-head'.
> The 'write_fetch_head' variable that decides if we actually write
> FETCH_HEAD remains there, retaining its meaning, but use this new
> variable and 'dry_run' to decide if we report about FETCH_HEAD.
> Suggested-by: Junio C Hamano <>
> Signed-off-by: Jonathan Tan <>
> ---

Thanks - this looks good.

      reply	other threads:[~2020-09-03 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 19:02 [PATCH] " Jonathan Tan
2020-09-02 20:07 ` Junio C Hamano
2020-09-02 21:05   ` [PATCH v2] " Jonathan Tan
2020-09-02 21:27     ` Junio C Hamano
2020-09-02 23:56     ` Jonathan Nieder
2020-09-03  2:03       ` Junio C Hamano
2020-09-03 19:41         ` [PATCH v3] " Jonathan Tan
2020-09-03 21:00           ` Junio C Hamano
2020-09-03 21:06             ` Jonathan Tan [this message]

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:

  List information:

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

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH v3] fetch: no FETCH_HEAD display if --no-write-fetch-head' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

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 read-only IMAP folder(s) and NNTP newsgroup(s).