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

Re: [PATCH 1/2] t2016: require the PERL prereq only when necessary

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 1, 2021, 22:25 UTC
Message-ID
<xmqqlf14ynco.fsf@gitster.g>
In-Reply-To
<a0cf71031781b481b092d0f501bc4d78376543f3.1638281655.git.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 13 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> The scripted version of the interactive mode of `git add` still requires
> Perl, but the built-in version does not. Let's only require the PERL
> prereq if testing the scripted version.
>
> This addresses a long-standing NEEDSWORK added in 35166b1fb54 (t2016:
> add a NEEDSWORK about the PERL prerequisite, 2020-10-07).
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  t/t2016-checkout-patch.sh | 42 ++++++++++++++++++++-------------------
>  1 file changed, 22 insertions(+), 20 deletions(-)

Good. I suspect there may not be too many developers who lack PERL prerequisite around here, so it is not like the built-in version was not sufficiently tested in developers' environment without this patch, but it is nice to see us move in this direction. Of course, when we remove the non-builtin version, we'd further be able to lose these prerequisites.

Show 29 quoted lines
> diff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh
> index abfd586c32b..71c5a15be00 100755
> --- a/t/t2016-checkout-patch.sh
> +++ b/t/t2016-checkout-patch.sh
> @@ -4,7 +4,13 @@ test_description='git checkout --patch'
>  
>  . ./lib-patch-mode.sh
>  
> -test_expect_success PERL 'setup' '
> +if ! test_bool_env GIT_TEST_ADD_I_USE_BUILTIN false && ! test_have_prereq PERL
> +then
> +	skip_all='skipping interactive add tests, PERL not set'
> +	test_done
> +fi
> +
> +test_expect_success 'setup' '
>  	mkdir dir &&
>  	echo parent > dir/foo &&
>  	echo dummy > bar &&
> @@ -18,44 +24,40 @@ test_expect_success PERL 'setup' '
>  
>  # note: bar sorts before dir/foo, so the first 'n' is always to skip 'bar'
>  
> -# NEEDSWORK: Since the builtin add-p is used when $GIT_TEST_ADD_I_USE_BUILTIN
> -# is given, we should replace the PERL prerequisite with an ADD_I prerequisite
> -# which first checks if $GIT_TEST_ADD_I_USE_BUILTIN is defined before checking
> -# PERL.
> -test_expect_success PERL 'saying "n" does nothing' '
> +test_expect_success 'saying "n" does nothing' '
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin
Message 3 of 23 in “Use the built-in implementation of the interactive add command by default”
  1. 0/2 Use the built-in implementation of the interactive add command by defaultJohannes Schindelin via GitGitGadget, Nov 30, 2021
  2. 1/2 t2016: require the PERL prereq only when necessaryJohannes Schindelin via GitGitGadget, Nov 30, 2021
  3. Junio C HamanoDec 1, 2021
  4. Johannes SchindelinDec 2, 2021
  5. 2/2 add -i: default to the built-in implementationJohannes Schindelin via GitGitGadget, Nov 30, 2021
  6. Phillip WoodDec 1, 2021
  7. Johannes SchindelinDec 2, 2021
  8. Junio C HamanoDec 2, 2021
  9. Ramsay JonesDec 2, 2021
  10. Johannes SchindelinDec 10, 2021
  11. Ævar Arnfjörð BjarmasonDec 1, 2021
  12. Junio C HamanoDec 1, 2021
  13. Junio C HamanoDec 1, 2021
  14. Johannes SchindelinDec 2, 2021
  15. fixup! add -i: default to the built-in implementationJunio C Hamano, Dec 9, 2021
  16. Johannes SchindelinDec 10, 2021
  17. Jeff KingNov 30, 2021
  18. Junio C HamanoNov 30, 2021
  19. Ævar Arnfjörð BjarmasonDec 1, 2021
  20. Carlo ArenasDec 1, 2021
  21. Johannes SchindelinDec 2, 2021
  22. Philippe BlainDec 3, 2021
  23. Johannes SchindelinDec 6, 2021

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.