All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Justin Tobler <jltobler@gmail.com>
Cc: git@vger.kernel.org,  ps@pks.im,  phillip.wood123@gmail.com,
	alan@norbauer.com
Subject: Re: [PATCH v2 0/3] clone: suppress unexpected advice message during clone
Date: Sun, 23 Mar 2025 12:38:03 -0700	[thread overview]
Message-ID: <xmqqtt7jr10k.fsf@gitster.g> (raw)
In-Reply-To: <20250321231639.180762-1-jltobler@gmail.com> (Justin Tobler's message of "Fri, 21 Mar 2025 18:16:36 -0500")

Justin Tobler <jltobler@gmail.com> writes:

> It has been reported[1] that starting in Git v2.45.0, cloning from a bundle
> results in the default branch name advice message always being displayed
> when it was previously not. It can be reproduced by the following:
>
>         git init bundle-repo &&
>         git -C bundle-repo --allow-empty -m init &&

Presumably this is "commit --allow-empty -m init" in the bundle-repo
repository?

>         git -C bundle-repo bundle create ../repo.bundle --all &&
>         git clone repo.bundle bundle-clone
>
> This issue bisects to 199f44cb2ead (builtin/clone: allow remote helpers
> ...
> This series addresses the issue by adapting `guess_remote_head()` to
> support configuring the underlying `git_default_branch_name()`, which
> has since been renamed to `repo_default_branch_name()`, to be quiet and
> suppress the advice message.

Nicely analyzed and described.

> Changes since V1:
>
>         - Instead of adding an additional boolean to
>           `guess_remote_head()` to suppress the advice message, the
>           function is adapted to accepts flags that accoplish the same
>           thing.
>
>         - Added a test to validate that the advice message is not being
>           printed.
>
>         - While we are here, added another patch to allow the default
>           branch name advice message to be suppressrd by the
>           `--no-advice` option.
>
> Thanks,
> -Justin

>
> [1]: <7EC98E2F-144D-4974-94F6-FC24B443651D@norbauer.com>
>
> Justin Tobler (3):
>   remote: allow `guess_remote_head()` to suppress advice
>   builtin/clone: suppress unexpected default branch advice
>   advice: allow disabling default branch name advice
>
>  advice.c                |  1 +
>  advice.h                |  1 +
>  builtin/clone.c         |  3 ++-
>  builtin/fetch.c         |  2 +-
>  builtin/remote.c        |  2 +-
>  refs.c                  |  3 ++-
>  remote.c                | 10 ++++++----
>  remote.h                | 11 +++++++----
>  t/t0001-init.sh         |  8 ++++++++
>  t/t5607-clone-bundle.sh | 12 ++++++++++++
>  10 files changed, 41 insertions(+), 12 deletions(-)
>
>
> base-commit: 683c54c999c301c2cd6f715c411407c413b1d84e

  parent reply	other threads:[~2025-03-23 19:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19  9:53 bug: git shows hints that should be suppressed alan
2025-03-19  9:58 ` alan
2025-03-19 14:45 ` Elijah Newren
2025-03-20  1:36   ` Justin Tobler
2025-03-20  1:46     ` [PATCH 0/2] clone: suppress unexpected advice message during clone Justin Tobler
2025-03-20  1:46       ` [PATCH 1/2] remote: allow `guess_remote_head()` to suppress advice Justin Tobler
2025-03-20  5:13         ` Patrick Steinhardt
2025-03-20 23:30           ` Justin Tobler
2025-03-21  8:52           ` Junio C Hamano
2025-03-20  1:46       ` [PATCH 2/2] clone: suppress unexpected default branch advice Justin Tobler
2025-03-20  5:13         ` Patrick Steinhardt
2025-03-20 23:36           ` Justin Tobler
2025-03-20 11:10       ` [PATCH 0/2] clone: suppress unexpected advice message during clone Phillip Wood
2025-03-20 23:48         ` Justin Tobler
2025-03-21 16:42           ` Phillip Wood
2025-03-21 23:16       ` [PATCH v2 0/3] " Justin Tobler
2025-03-21 23:16         ` [PATCH v2 1/3] remote: allow `guess_remote_head()` to suppress advice Justin Tobler
2025-03-24  9:31           ` Phillip Wood
2025-03-24 15:21             ` Justin Tobler
2025-03-24 19:29               ` phillip.wood123
2025-03-21 23:16         ` [PATCH v2 2/3] builtin/clone: suppress unexpected default branch advice Justin Tobler
2025-03-24  9:32           ` Phillip Wood
2025-03-24 15:35             ` Justin Tobler
2025-03-21 23:16         ` [PATCH v2 3/3] advice: allow disabling default branch name advice Justin Tobler
2025-03-24  9:32           ` Phillip Wood
2025-03-23 19:38         ` Junio C Hamano [this message]
2025-03-25  0:51         ` [PATCH v3 0/3] clone: suppress unexpected advice message during clone Justin Tobler
2025-03-25  0:51           ` [PATCH v3 1/3] remote: allow `guess_remote_head()` to suppress advice Justin Tobler
2025-03-25  0:51           ` [PATCH v3 2/3] builtin/clone: suppress unexpected default branch advice Justin Tobler
2025-03-25  0:51           ` [PATCH v3 3/3] advice: allow disabling default branch name advice Justin Tobler
2025-03-25 14:35           ` [PATCH v3 0/3] clone: suppress unexpected advice message during clone Phillip Wood
2025-03-20  4:05     ` bug: git shows hints that should be suppressed alan

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=xmqqtt7jr10k.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=alan@norbauer.com \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=phillip.wood123@gmail.com \
    --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 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.