All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matt Hunter <m@lfurio.us>
Cc: git@vger.kernel.org,  Bence Ferdinandy <bence@ferdinandy.com>,
	 Jeff King <peff@peff.net>
Subject: Re: [PATCH v2 0/7] Introduce fetch.followRemoteHEAD config variable
Date: Wed, 17 Jun 2026 04:51:06 -0700	[thread overview]
Message-ID: <xmqqcxxp1j2t.fsf@gitster.g> (raw)
In-Reply-To: <xmqqh5n213bw.fsf@gitster.g> (Junio C. Hamano's message of "Tue, 16 Jun 2026 16:18:59 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> ... to some "unspecified" or "default" value?  What does the existing
> parser routine for remote.*.followremotehead do?
>
> Ideally,
>
>  (1) If the "fetch" operation ends up with not needing to consult
>      the value of fetch.followRemoteHEAD at all (e.g., it is a
>      one-shot fetch that updates no remote-tracking hierarchy, or it
>      has a more specific per-remote setting that this variable is
>      meant to serve as a mere fallback), any bogus or unknown value
>      will not get any warning.
>
>  (2) If fetch.followRemoteHEAD ends up being _used_, and if it has
>      an unknown value, we should at least warn "we do not understand
>      what you wrote, 'awlays', and we ignore it", or die "we do not
>      understand 'reset', perhaps it is from a future version of Git?".
>
> I do not think customization based on git_config() callback like the
> above can easily implement such an ideal semantics.
>
> And I suspect that the existing per-remote configuration that this
> variable is meant to serve as a fallback definition would not work
> in such an ideal way (i.e., even if we are doing one-shot fetch that
> does not touch any remote-tracking hierarchies, "git fetch" may warn
> if the value is not understood, and when we do need the value, the
> code would only warn and does not die), ...

Having said all that, I do not think it is a blocker for this series
that it does not take us into the more ideal direction and still
makes a syntax check on a value that will not be used and complains
to the user.  We may want an in-code NEEDSWORK comment to hint
future developers that they may want to revamp both of the code
paths for fetch.followRemoteHEAD and remote.*.followremotehead not
to complain when the values are unneeded and die when the unrecognized
value is needed to continue, though.

Other than that, this looks excellent.  Thanks.

      reply	other threads:[~2026-06-17 11:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05 16:31 followRemoteHEAD management question Matt Hunter
2026-06-08 23:49 ` Jeff King
2026-06-11  4:12   ` Matt Hunter
2026-06-11  6:01     ` Jeff King
2026-06-11 20:36       ` Bence Ferdinandy
2026-06-12  6:11         ` Matt Hunter
2026-06-12  5:55 ` [PATCH 0/7] Introduce fetch.followRemoteHEAD config option Matt Hunter
2026-06-12  5:55   ` [PATCH 1/7] fetch: fixup set_head advice for warn-if-not-branch Matt Hunter
2026-06-12  5:55   ` [PATCH 2/7] doc: explain fetchRemoteHEADWarn advice Matt Hunter
2026-06-12  5:55   ` [PATCH 3/7] t5510: cleanup remote in followRemoteHEAD dangling ref test Matt Hunter
2026-06-12  5:55   ` [PATCH 4/7] fetch: rename function report_set_head Matt Hunter
2026-06-12  5:55   ` [PATCH 5/7] fetch: refactor do_fetch handling of followRemoteHEAD Matt Hunter
2026-06-12  5:55   ` [PATCH 6/7] fetch: add configuration option fetch.followRemoteHEAD Matt Hunter
2026-06-12 14:00     ` Matt Hunter
2026-06-12 14:17     ` Junio C Hamano
2026-06-13  2:58       ` Matt Hunter
2026-06-12  5:55   ` [PATCH 7/7] fetch: fixup a misaligned comment Matt Hunter
2026-06-16 22:25   ` [PATCH v2 0/7] Introduce fetch.followRemoteHEAD config variable Matt Hunter
2026-06-16 22:25     ` [PATCH v2 1/7] fetch: fixup set_head advice for warn-if-not-branch Matt Hunter
2026-06-16 22:25     ` [PATCH v2 2/7] doc: explain fetchRemoteHEADWarn advice Matt Hunter
2026-06-16 22:25     ` [PATCH v2 3/7] t5510: cleanup remote in followRemoteHEAD dangling ref test Matt Hunter
2026-06-16 22:25     ` [PATCH v2 4/7] fetch: rename function report_set_head Matt Hunter
2026-06-16 22:25     ` [PATCH v2 5/7] fetch: refactor do_fetch handling of followRemoteHEAD Matt Hunter
2026-06-16 22:25     ` [PATCH v2 6/7] fetch: add configuration variable fetch.followRemoteHEAD Matt Hunter
2026-06-16 22:25     ` [PATCH v2 7/7] fetch: fixup a misaligned comment Matt Hunter
2026-06-16 23:18     ` [PATCH v2 0/7] Introduce fetch.followRemoteHEAD config variable Junio C Hamano
2026-06-17 11:51       ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqcxxp1j2t.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bence@ferdinandy.com \
    --cc=git@vger.kernel.org \
    --cc=m@lfurio.us \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.