From: Junio C Hamano Date: Fri, 16 Oct 2026 22:02:40 GMT Subject: Re: [PATCH v4] doc: checkout: rewrite detached HEAD state explanation Message-ID: In-Reply-To: "Julia Evans via GitGitGadget" writes: > advice.c | 1 + > ... > diff --git a/advice.c b/advice.c > index 401d047391..8d2c1ff1ee 100644 > --- a/advice.c > +++ b/advice.c > @@ -291,6 +291,7 @@ void detach_advice(const char *new_name) > "\n" > " git switch -\n" > "\n" > + "Run `git help detached-head` to learn more.\n" > "Turn off this advice by setting config variable advice.detachedHead to false\n\n"); > > fprintf(stderr, fmt, new_name); This breaks t2020 without an accompanying change. You can squash in the attached patch to unbreak the test. Since nobody's terminal talks markdown or asciidoc, let's use the vanilla single quote instead of backquote while we are at it. advice.c | 2 +- t/t2020-checkout-detach.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git c/advice.c w/advice.c index 8d2c1ff1ee..3238e9b866 100644 --- c/advice.c +++ w/advice.c @@ -291,7 +291,7 @@ void detach_advice(const char *new_name) "\n" " git switch -\n" "\n" - "Run `git help detached-head` to learn more.\n" + "Run 'git help detached-head' to learn more.\n" "Turn off this advice by setting config variable advice.detachedHead to false\n\n"); fprintf(stderr, fmt, new_name); diff --git c/t/t2020-checkout-detach.sh w/t/t2020-checkout-detach.sh index 28bbbe6c05..804dc2a67f 100755 --- c/t/t2020-checkout-detach.sh +++ w/t/t2020-checkout-detach.sh @@ -228,6 +228,7 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as git switch - + Run ${SQ}git help detached-head${SQ} to learn more. Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at \$commit three @@ -310,6 +311,7 @@ test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked git switch - + Run ${SQ}git help detached-head${SQ} to learn more. Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at \$commit... three