From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Alex Henrie <alexhenrie24@gmail.com>,
git@vger.kernel.org, pclouds@gmail.com
Subject: Re: [PATCH v2] switch: mention the --detach option when dying due to lack of a branch
Date: Fri, 25 Feb 2022 12:57:01 +0100 [thread overview]
Message-ID: <220225.86h78n88gb.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqv8x4m6jn.fsf@gitster.g>
On Thu, Feb 24 2022, Junio C Hamano wrote:
> Alex Henrie <alexhenrie24@gmail.com> writes:
>> diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
>> index ebb961be29..f54691bac9 100755
>> --- a/t/t2060-switch.sh
>> +++ b/t/t2060-switch.sh
>> @@ -32,6 +32,17 @@ test_expect_success 'switch and detach' '
>> test_must_fail git symbolic-ref HEAD
>> '
>>
>> +test_expect_success 'suggestion to detach' '
>> + test_must_fail git switch main^{commit} 2>stderr &&
>> + test_i18ngrep "try again with the --detach option" stderr
>> +'
>> +
>> +test_expect_success 'suggestion to detach is suppressed with advice.suggestDetachingHead=false' '
>> + test_config advice.suggestDetachingHead false &&
>> + test_must_fail git switch main^{commit} 2>stderr &&
>> + test_i18ngrep ! "try again with the --detach option" stderr
>> +'
>
> OK, we try to be consistent with other tests in the file, and leave
> s/test_i18n// to a file-wide clean-up outside the topic.
FWIW that's not the case here. This is the first use of test_i18ngrep in
this file.
But better to use test_cmp as noted in
<220224.86sfs8abj6.gmgdl@evledraar.gmail.com> in the sid-thread.
next prev parent reply other threads:[~2022-02-25 11:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 6:47 [PATCH v2] switch: mention the --detach option when dying due to lack of a branch Alex Henrie
2022-02-24 8:53 ` Ævar Arnfjörð Bjarmason
2022-02-24 19:02 ` Junio C Hamano
2022-02-25 11:57 ` Ævar Arnfjörð Bjarmason [this message]
2022-02-25 17:20 ` Alex Henrie
2022-02-25 17:26 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=220225.86h78n88gb.gmgdl@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=alexhenrie24@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).