From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, "Jeff King" <peff@peff.net>,
"Patrick Steinhardt" <ps@pks.im>,
"Jonathan Nieder" <jrnieder@gmail.com>,
"Daniel Martí" <mvdan@mvdan.cc>
Subject: Re: [PATCH 1/2] Add fetch.updateHead option
Date: Wed, 05 Apr 2023 11:28:56 +0200 [thread overview]
Message-ID: <230405.86bkk2vfpo.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <20230405012742.2452208-2-felipe.contreras@gmail.com>
On Tue, Apr 04 2023, Felipe Contreras wrote:
> Users might change the behavior when running "git fetch" so that the
> remote's HEAD symbolic ref is updated at certain point.
>
> For example after running "git remote add" the remote HEAD is not
> set like it is with "git clone".
>
> Setting "fetch.updatehead = missing" would probably be a sensible
> default that everyone would want, but for now the default behavior is to
> never update HEAD, so there shouldn't be any functional changes.
>
> For the next major version of Git, we might want to change this default.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> Documentation/config/fetch.txt | 4 +++
> Documentation/config/remote.txt | 3 ++
> builtin/fetch.c | 64 ++++++++++++++++++++++++++++++++-
> remote.c | 21 +++++++++++
> remote.h | 11 ++++++
> t/t5510-fetch.sh | 31 ++++++++++++++++
> 6 files changed, 133 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/config/fetch.txt b/Documentation/config/fetch.txt
> index 568f0f75b3..dc147ffb35 100644
> --- a/Documentation/config/fetch.txt
> +++ b/Documentation/config/fetch.txt
> @@ -120,3 +120,7 @@ fetch.bundleCreationToken::
> The creation token values are chosen by the provider serving the specific
> bundle URI. If you modify the URI at `fetch.bundleURI`, then be sure to
> remove the value for the `fetch.bundleCreationToken` value before fetching.
> +
> +fetch.updateHead::
> + Defines when to update the remote HEAD symbolic ref. Values are 'never',
> + 'missing' (update only when HEAD is missing), and 'always'.
Missed the first time around, I think it would be useful to explain the
historical behavior heher, and why it's been in place.
I.e. that we use this during the initial fetch/clone to find the "HEAD",
for discovering the default branch, but then proceed to not care about
it after that.
We should also link and cross-link to the other recent-ish config
options (whose name I'm blanking on), which implement the "take the
remote's suggestion of a default branch name" here.
next prev parent reply other threads:[~2023-04-05 9:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-04-05 1:27 ` [PATCH 2/2] fetch: add support for HEAD update on mirrors Felipe Contreras
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=230405.86bkk2vfpo.gmgdl@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=mvdan@mvdan.cc \
--cc=peff@peff.net \
--cc=ps@pks.im \
/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 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).