Re: [PATCH] completion: clear cached --options when sourcing the completion script
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 23, 2018, 17:35 UTC
- Message-ID
- <xmqq7eq2k840.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <xmqqbmfek8ml.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 28 quoted lines
> SZEDER Gábor <szeder.dev@gmail.com> writes:
>
>> Hang on, this test fails in the GETTEXT_POISON build.
>
> Thanks.
>
>> The thing is, we get the merge strategies with this piece of code in
>> __git_list_merge_strategies() in master:
>>
>> LANG=C LC_ALL=C git merge -s help 2>&1 |
>> sed -n -e '/[Aa]vailable strategies are: /,/^$/{
>> # a couple of s/// commands
>> }'
>>
>>
>> and that '/[Aa]vailable strategies are: /' won't match in a
>> GETTEXT_POISON-ed output, because that string is translated.
>>
>> I think for now (-rc phase) we should just drop this test, and in the
>> future we should consider adding a 'git merge --list-strategies' option.
>
> I'd say we should just add !GETTEXT_POISON prereq to the problematic
> tests.
>
> "git merge -s help" output under forced C locale is dependable in
> the real world. It is GETTEXT_POISON that does not get this fact
> right. There is no need for '--list-strat' option to make this test
> pass.IOW, this is the minumum required.
By the way, shouldn't we be running the body of these new tests inside a subshell? Otherwise a dot-sourcing by an earlier test of these new ones _will_ affect all the subsequent tests.
t/t9902-completion.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 4c86adadf2..b7f5b1e632 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -1511,7 +1511,7 @@ test_expect_success 'sourcing the completion script clears cached porcelain comm verbose test -z "$__git_porcelain_commands" ' -test_expect_success 'sourcing the completion script clears cached merge strategies' ' +test_expect_success !GETTEXT_POISON 'sourcing the completion script clears cached merge strategies' ' __git_compute_merge_strategies && verbose test -n "$__git_merge_strategies" && . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&