mbox series

[0/2] Add fetch.updateHead option

Message ID 20230405012742.2452208-1-felipe.contreras@gmail.com (mailing list archive)
Headers show
Series Add fetch.updateHead option | expand

Message

Felipe Contreras April 5, 2023, 1:27 a.m. UTC
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(-)