list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <>
To: Junio C Hamano <>
Cc: "Ævar Arnfjörð Bjarmason" <>,
	Git <>, "Jeff King" <>,
	"Jonathan Nieder" <>,
	"Dominik Salvet" <>
Subject: Re: [RFC/PATCH] Add fetch.updateHead option
Date: Wed, 18 Nov 2020 13:04:54 -0600	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, Nov 18, 2020 at 9:53 AM Junio C Hamano <> wrote:
> Ævar Arnfjörð Bjarmason <> writes:

> > I haven't taken much time to re-think through the patch/implications of
> > this, but I remember running into this and going through some pre-patch
> > investigation at some point.
> >
> > It's really annoying in some cases that "clone" isn't creating the same
> > state as "remote". IIRC I was doing some heuristics to figure out the
> > remote branch name etc.
> >
> > Isn't this something we can just change without an option? There were a
> > bunch of cases in clone/fetch that were different for no different
> > reasons, IIRC I patched one or two of those in the past. But I haven't
> > gone through the history of the feature and checked if it was
> > intentional.
> I think what Peff outlined earlier was reasonable.  "remote add -f",
> since it talks with the remote, should be able to learn where their
> HEAD points at and set it up.  "remote add" that does not talk to
> the remote cannot do so and "fetch" could help but we should not
> touch existing refs/remotes/$name/HEAD by default [*1*], as the
> symref is meant to indicate the local choice of which one of their
> branches is significant to _us_ and what "clone" does is merely to
> give it the initial value.

The new suggested behavior (fetch.updatehead = missing) is that "git
fetch" touches $remote/HEAD *only* when it doesn't exist.

So if you set $remote/HEAD manually, you would not affected.

However, that behavior is clearly not ideal in the long term, since it
seems basically nobody uses that feature.

Either way I see no argument against adding this option, and making
the default fetch.updatehead = never, which doesn't change the current
behavior at all.

> But when interacting with a remote whose choice of HEAD is always
> what the local user wants to follow, letting "git fetch" update
> refs/remotes/$name/HEAD to a newly observed value would be a welcome
> optional feature.

That would be fetch.updatehead = always.


Felipe Contreras

  reply	other threads:[~2020-11-18 19:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18  9:12 Felipe Contreras
2020-11-18  9:30 ` Ævar Arnfjörð Bjarmason
2020-11-18  9:43   ` Felipe Contreras
2020-11-18 15:53   ` Junio C Hamano
2020-11-18 19:04     ` Felipe Contreras [this message]
2020-11-20 23:52 ` Jeff King
2020-11-21  0:28   ` Junio C Hamano
2020-11-21  0:40     ` Jeff King
2020-11-21  1:18       ` Felipe Contreras
2020-11-24  6:58         ` Jeff King
2020-11-21  1:53     ` Felipe Contreras
2020-11-21  1:41   ` Felipe Contreras
2020-11-24  7:09     ` 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:

  List information:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \
    --subject='Re: [RFC/PATCH] Add fetch.updateHead option' \

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