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

Re: [RFC/PATCH] Add fetch.updateHead option

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 18, 2020, 09:43 UTC
Message-ID
<CAMP44s1i+defrfkCprTAOqyJSCAUMsqWe3Fyv+Y2TeAyiAdg8g@mail.gmail.com>
In-Reply-To
<87wnyjdnb3.fsf@evledraar.gmail.com>

On Wed, Nov 18, 2020 at 3:30 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 13 quoted lines
> 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.

Apparently remote/HEAD is supposed to be set manually, which is why there is "git remote add -m master", and "git remote set-head origin master".

Personally I don't see any point in that.

I think if no remote/HEAD is set (manually), it should be set automatically on the first "git fetch", and that should mirror the behavior of "git clone". This would be the equivalent of "fetch.updatehead = missing", which in my opinion should be the default.

This configuration was suggested by Jeff King, see:
https://lore.kernel.org/git/20201118020618.GE650959@coredump.intra.peff.net/

Personally I don't need a configuration, I would be happy if "fetch.updatehead = missing" was the default.

Cheers.
-- 
Felipe Contreras
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 3 of 13 in “Add fetch.updateHead option”
  1. Add fetch.updateHead optionFelipe Contreras, Nov 18, 2020
  2. Ævar Arnfjörð BjarmasonNov 18, 2020
  3. Felipe ContrerasNov 18, 2020
  4. Junio C HamanoNov 18, 2020
  5. Felipe ContrerasNov 18, 2020
  6. Jeff KingNov 20, 2020
  7. Junio C HamanoNov 21, 2020
  8. Jeff KingNov 21, 2020
  9. Felipe ContrerasNov 21, 2020
  10. Jeff KingNov 24, 2020
  11. Felipe ContrerasNov 21, 2020
  12. Felipe ContrerasNov 21, 2020
  13. Jeff KingNov 24, 2020

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.