git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/3] clone: suppress unexpected advice message during clone

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 23, 2025, 19:38 UTC
Message-ID
<xmqqtt7jr10k.fsf@gitster.g>
In-Reply-To
<20250321231639.180762-1-jltobler@gmail.com>
Justin Tobler <jltobler@gmail.com> writes:
Show 6 quoted lines
> 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?

Show 9 quoted lines
>         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.
Show 16 quoted lines
> 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
Show 22 quoted lines
>
> [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
Previous: Phillip WoodNext: Justin Tobler
Message 26 of 32 in “bug: git shows hints that should be suppressed”
  1. alan@norbauer.comMar 19, 2025
  2. alan@norbauer.comMar 19, 2025
  3. Elijah NewrenMar 19, 2025
  4. Justin ToblerMar 20, 2025
  5. 0/2 clone: suppress unexpected advice message during cloneJustin Tobler, Mar 20, 2025
  6. 1/2 remote: allow `guess_remote_head()` to suppress adviceJustin Tobler, Mar 20, 2025
  7. Patrick SteinhardtMar 20, 2025
  8. Justin ToblerMar 20, 2025
  9. Junio C HamanoMar 21, 2025
  10. 2/2 clone: suppress unexpected default branch adviceJustin Tobler, Mar 20, 2025
  11. Patrick SteinhardtMar 20, 2025
  12. Justin ToblerMar 20, 2025
  13. Phillip WoodMar 20, 2025
  14. Justin ToblerMar 20, 2025
  15. Phillip WoodMar 21, 2025
  16. 0/3 clone: suppress unexpected advice message during cloneJustin Tobler, Mar 21, 2025
  17. 1/3 remote: allow `guess_remote_head()` to suppress adviceJustin Tobler, Mar 21, 2025
  18. Phillip WoodMar 24, 2025
  19. Justin ToblerMar 24, 2025
  20. phillip.wood123@gmail.comMar 24, 2025
  21. 2/3 builtin/clone: suppress unexpected default branch adviceJustin Tobler, Mar 21, 2025
  22. Phillip WoodMar 24, 2025
  23. Justin ToblerMar 24, 2025
  24. 3/3 advice: allow disabling default branch name adviceJustin Tobler, Mar 21, 2025
  25. Phillip WoodMar 24, 2025
  26. Junio C HamanoMar 23, 2025
  27. 0/3 clone: suppress unexpected advice message during cloneJustin Tobler, Mar 25, 2025
  28. 1/3 remote: allow `guess_remote_head()` to suppress adviceJustin Tobler, Mar 25, 2025
  29. 2/3 builtin/clone: suppress unexpected default branch adviceJustin Tobler, Mar 25, 2025
  30. 3/3 advice: allow disabling default branch name adviceJustin Tobler, Mar 25, 2025
  31. Phillip WoodMar 25, 2025
  32. alan@norbauer.comMar 20, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.