git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add fetch.updateHead option
@ 2023-04-05  1:27 Felipe Contreras
  2023-04-05  1:27 ` [PATCH 1/2] " Felipe Contreras
  2023-04-05  1:27 ` [PATCH 2/2] fetch: add support for HEAD update on mirrors Felipe Contreras
  0 siblings, 2 replies; 9+ messages in thread
From: Felipe Contreras @ 2023-04-05  1:27 UTC (permalink / raw)
  To: git
  Cc: Ævar Arnfjörð Bjarmason, Jeff King,
	Patrick Steinhardt, Jonathan Nieder, Daniel Martí,
	Felipe Contreras

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-04-07  2:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-05  1:27 [PATCH 0/2] Add fetch.updateHead option Felipe Contreras
2023-04-05  1:27 ` [PATCH 1/2] " Felipe Contreras
2023-04-05  9:16   ` Ævar Arnfjörð Bjarmason
2023-04-05 10:15     ` Patrick Steinhardt
2023-04-05 14:55     ` Felipe Contreras
2023-04-06  7:33       ` Ævar Arnfjörð Bjarmason
2023-04-07  2:41         ` Felipe Contreras
2023-04-05  9:28   ` Ævar Arnfjörð Bjarmason
2023-04-05  1:27 ` [PATCH 2/2] fetch: add support for HEAD update on mirrors Felipe Contreras

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