Re: [PATCH 2/3] checkout: advise when orphaned commit checks are slow
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 11, 2026, 18:52 UTC
- Message-ID
- <xmqqtslnmc9b.fsf@gitster.g>
- In-Reply-To
- <a9b81eb87684fa9bfbc83e845eb67ded8d7cb6d9.1794337920.git.gitgitgadget@gmail.com>
"Wyatt Holden via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 17 quoted lines
> diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
> index d21dbd5b72..7dfaaab1b8 100755
> --- a/t/t2020-checkout-detach.sh
> +++ b/t/t2020-checkout-detach.sh
> @@ -186,6 +186,46 @@ do
> check_not_detached
> '
>
> + test_expect_success "$command advises when the orphan check is slow" '
> + git checkout --detach "$orphan2" &&
> + GIT_TEST_CHECKOUT_DELAY_WARNING=true \
> + git $command main 2>stderr &&
> + check_orphan_warning stderr "2 commits" &&
> + test_grep -E "^hint: Checking for orphaned commits took [0-9]+[.][0-9]{2} seconds[.]$" stderr &&
> + test_grep "git config set checkout.orphanedCommitWarning false" stderr &&
> + test_grep "git config set advice.checkoutOrphanedCommitWarning false" stderr
> + 'This test will not pass in the modern world where the advice message suggests to use "git config set --global advice.FOO false".
It probably makes sense to grep for something looser like
"git config .* advice\.checkoutOrphanedCommitWarning"