mbox series

[RFC,v1,0/2] set_head finishing touches

Message ID 20241203215713.135068-1-bence@ferdinandy.com (mailing list archive)
Headers show
Series set_head finishing touches | expand

Message

Bence Ferdinandy Dec. 3, 2024, 9:56 p.m. UTC
This series is intended to be the finishing touches on the fetch/remote
set_head changes as in built off of bf/fetch-set-head-config
<20241128230806.2058962-1-bence@ferdinandy.com>.

Patch 1/2 contains the missing setting Junio was missing, while 2/2 is
an attempt to do the right thing.

I've marked them as RFC because I'm not sure about a couple of things:

- 1/2 contains a slight refactor by extracting the hints into a separate
  function to avoid writing it twice. It could be argued that this
  refactor could be in a separate patch.

- I'm not exactly sure what should be in this hint, I added the new
  "warn-if-not-$branch", but arguments could be made for adding
  "always", adding a generic "or see the other possible settings in the
  manual" or any other combination

- I've seen some examples of advice stuff in yellow that can be
  disabled, so maybe a complete explanation of possibilites could be
  done with that mechanism (I haven't yet looked into how that works)

- I'm also not entirely sure about 2/2. I think it's a safe move, that
  is very unlikely to be annoying, but it's hard to judge from my
  limited perspective on all the different possible workflows.

Bence Ferdinandy (2):
  fetch set_head: add warn-if-not-$branch option
  remote set-head: set followRemoteHEAD to "warn" if "always"

 builtin/fetch.c   | 26 ++++++++++++++++++-------
 builtin/remote.c  | 12 +++++++++++-
 remote.c          |  5 +++++
 remote.h          |  6 ++++--
 t/t5505-remote.sh | 11 +++++++++++
 t/t5510-fetch.sh  | 49 +++++++++++++++++++++++++++++++++++++++++++++--
 6 files changed, 97 insertions(+), 12 deletions(-)