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

[PATCH 0/2] Add fetch.updateHead option

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 5, 2023, 01:27 UTC
Message-ID
<20230405012742.2452208-1-felipe.contreras@gmail.com>

It's surprising that `git clone` and `git init && git remote add -f` don't create the same remote state.

Fix this by introducing a new configuration: `fetch.updateHead` which updates the remote `HEAD` when it's not present with "missing", or always with "always".

By default it's "never", which retains the current behavior.
This has already been discussed before [1].
[1] https://lore.kernel.org/git/20201118091219.3341585-1-felipe.contreras@gmail.com/
Felipe Contreras (2):
  Add fetch.updateHead option
  fetch: add support for HEAD update on mirrors
 Documentation/config/fetch.txt  |  4 ++
 Documentation/config/remote.txt |  3 ++
 builtin/fetch.c                 | 69 ++++++++++++++++++++++++++++++++-
 remote.c                        | 21 ++++++++++
 remote.h                        | 11 ++++++
 t/t5510-fetch.sh                | 49 +++++++++++++++++++++++
 6 files changed, 156 insertions(+), 1 deletion(-)
-- 
2.40.0+fc1
Next: Felipe Contreras
Message 1 of 9 in “Add fetch.updateHead option”
  1. 0/2 Add fetch.updateHead optionFelipe Contreras, Apr 5, 2023
  2. 1/2 Add fetch.updateHead optionFelipe Contreras, Apr 5, 2023
  3. Ævar Arnfjörð BjarmasonApr 5, 2023
  4. Patrick SteinhardtApr 5, 2023
  5. Felipe ContrerasApr 5, 2023
  6. Ævar Arnfjörð BjarmasonApr 6, 2023
  7. Felipe ContrerasApr 7, 2023
  8. Ævar Arnfjörð BjarmasonApr 5, 2023
  9. 2/2 fetch: add support for HEAD update on mirrorsFelipe Contreras, Apr 5, 2023

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.