From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>,
Karthik Nayak <karthik.188@gmail.com>,
Phillip Wood <phillip.wood123@gmail.com>
Subject: Re: [PATCH v3 14/20] t/lib-gpg: refactor `sanitize_pgp()` to not depend on Perl
Date: Tue, 1 Apr 2025 20:56:41 +0200 (CEST) [thread overview]
Message-ID: <c909b89f-7432-2d35-cfdb-0de9f94a7281@gmx.de> (raw)
In-Reply-To: <20250327-b4-pks-t-perlless-v3-14-b436de9da1b8@pks.im>
Hi Patrick,
On Thu, 27 Mar 2025, Patrick Steinhardt wrote:
> The `sanitize_pgp()` test helper uses Perl to strip PGP signatures from
> stdin. Refactor it to instead use awk(1) so that we drop the
> PERL_TEST_HELPERS prerequisite in users of this library.
It's my fault that this commit message is no longer correct because I
talked you into using `sed` instead...
Sorry,
Johannes
>
> Note that we have to add PERL_TEST_HELPERS to a subset of tests in t6300
> now that the test suite doesn't bail out early anymore in case the
> prerequisite isn't set.
>
> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> t/lib-gpg.sh | 6 +-----
> t/t6300-for-each-ref.sh | 21 ++++++++++-----------
> 2 files changed, 11 insertions(+), 16 deletions(-)
>
> diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
> index 3845b6ac449..937b876bd05 100644
> --- a/t/lib-gpg.sh
> +++ b/t/lib-gpg.sh
> @@ -192,9 +192,5 @@ test_lazy_prereq GPGSSH_VERIFYTIME '
> '
>
> sanitize_pgp() {
> - perl -ne '
> - /^-----END PGP/ and $in_pgp = 0;
> - print unless $in_pgp;
> - /^-----BEGIN PGP/ and $in_pgp = 1;
> - '
> + sed "/^-----BEGIN PGP/,/^-----END PGP/{/^-/p;d;}"
> }
> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> index 732a4d3171e..5db7038c417 100755
> --- a/t/t6300-for-each-ref.sh
> +++ b/t/t6300-for-each-ref.sh
> @@ -10,12 +10,6 @@ GNUPGHOME_NOT_USED=$GNUPGHOME
> . "$TEST_DIRECTORY"/lib-gpg.sh
> . "$TEST_DIRECTORY"/lib-terminal.sh
>
> -if ! test_have_prereq PERL_TEST_HELPERS
> -then
> - skip_all='skipping for-each-ref tests; Perl not available'
> - test_done
> -fi
> -
> # Mon Jul 3 23:18:43 2006 +0000
> datestamp=1151968723
> setdate_and_increment () {
> @@ -1215,7 +1209,7 @@ test_expect_success '%(raw) with --tcl must fail' '
> test_must_fail git for-each-ref --format="%(raw)" --tcl
> '
>
> -test_expect_success '%(raw) with --perl' '
> +test_expect_success PERL_TEST_HELPERS '%(raw) with --perl' '
> git for-each-ref --format="\$name= %(raw);
> print \"\$name\"" refs/myblobs/blob1 --perl | perl >actual &&
> cmp blob1 actual &&
> @@ -1442,9 +1436,14 @@ test_expect_success 'set up trailers for next test' '
> '
>
> test_trailer_option () {
> + if test "$#" -eq 3
> + then
> + prereq="$1"
> + shift
> + fi &&
> title=$1 option=$2
> cat >expect
> - test_expect_success "$title" '
> + test_expect_success $prereq "$title" '
> git for-each-ref --format="%($option)" refs/heads/main >actual &&
> test_cmp expect actual &&
> git for-each-ref --format="%(contents:$option)" refs/heads/main >actual &&
> @@ -1452,7 +1451,7 @@ test_trailer_option () {
> '
> }
>
> -test_trailer_option '%(trailers:unfold) unfolds trailers' \
> +test_trailer_option PERL_TEST_HELPERS '%(trailers:unfold) unfolds trailers' \
> 'trailers:unfold' <<-EOF
> $(unfold <trailers)
>
> @@ -1482,13 +1481,13 @@ test_trailer_option '%(trailers:only=no) shows all trailers' \
>
> EOF
>
> -test_trailer_option '%(trailers:only) and %(trailers:unfold) work together' \
> +test_trailer_option PERL_TEST_HELPERS '%(trailers:only) and %(trailers:unfold) work together' \
> 'trailers:only,unfold' <<-EOF
> $(grep -v patch.description <trailers | unfold)
>
> EOF
>
> -test_trailer_option '%(trailers:unfold) and %(trailers:only) work together' \
> +test_trailer_option PERL_TEST_HELPERS '%(trailers:unfold) and %(trailers:only) work together' \
> 'trailers:unfold,only' <<-EOF
> $(grep -v patch.description <trailers | unfold)
>
>
> --
> 2.49.0.472.ge94155a9ec.dirty
>
>
next prev parent reply other threads:[~2025-04-01 18:56 UTC|newest]
Thread overview: 125+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 9:35 [PATCH 00/20] t: drop Perl as a mandatory prerequisite Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 01/20] t: skip chain lint when PERL_PATH is unset Patrick Steinhardt
2025-03-20 18:36 ` Eric Sunshine
2025-03-20 9:35 ` [PATCH 02/20] t: refactor environment sanitization to not use Perl Patrick Steinhardt
2025-03-21 9:52 ` Karthik Nayak
2025-03-20 9:35 ` [PATCH 03/20] t: adapt character translation helpers " Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 04/20] t: adapt `test_copy_bytes()` " Patrick Steinhardt
2025-03-21 9:56 ` Karthik Nayak
2025-03-20 9:35 ` [PATCH 05/20] t: adapt `test_readlink()` " Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 06/20] t: introduce PERL_TEST_HELPERS prerequisite Patrick Steinhardt
2025-03-20 18:55 ` Eric Sunshine
2025-03-24 12:46 ` Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 07/20] t: adapt existing PERL prerequisites Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 08/20] meson: stop requiring Perl when tests are enabled Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 09/20] Makefile: stop requiring Perl when running tests Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 10/20] t: refactor tests depending on Perl transliteration operator Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 11/20] t: refactor tests depending on Perl substitution operator Patrick Steinhardt
2025-03-24 16:16 ` Phillip Wood
2025-03-20 9:35 ` [PATCH 12/20] t: refactor tests depending on Perl to print data Patrick Steinhardt
2025-03-20 19:33 ` Eric Sunshine
2025-03-24 12:46 ` Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 13/20] t: refactor tests depending on Perl for textconv scripts Patrick Steinhardt
2025-03-20 19:37 ` Eric Sunshine
2025-03-24 12:46 ` Patrick Steinhardt
2025-03-24 16:07 ` Eric Sunshine
2025-03-25 12:42 ` Patrick Steinhardt
2025-03-24 16:16 ` Phillip Wood
2025-03-25 12:43 ` Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 14/20] t/lib-gpg: refactor `sanitize_pgp()` to not depend on Perl Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 15/20] t/lib-t6000: refactor `name_from_description()` " Patrick Steinhardt
2025-03-20 19:41 ` Eric Sunshine
2025-03-24 12:46 ` Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 16/20] t/lib-httpd: refactor "one-time-perl" CGI script " Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 17/20] t0021: refactor `generate_random_characters()` " Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 18/20] t0210: refactor trace2 scrubbing to not use Perl Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 19/20] t5316: refactor `max_chain()` to not depend on Perl Patrick Steinhardt
2025-03-20 9:35 ` [PATCH 20/20] t5703: refactor test " Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 00/20] t: drop Perl as a mandatory prerequisite Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 01/20] t: skip chain lint when PERL_PATH is unset Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 02/20] t: refactor environment sanitization to not use Perl Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 03/20] t: adapt character translation helpers " Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 04/20] t: adapt `test_copy_bytes()` " Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 05/20] t: adapt `test_readlink()` " Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 06/20] t: introduce PERL_TEST_HELPERS prerequisite Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 07/20] t: adapt existing PERL prerequisites Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 08/20] meson: stop requiring Perl when tests are enabled Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 09/20] Makefile: stop requiring Perl when running tests Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 10/20] t: refactor tests depending on Perl transliteration operator Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 11/20] t: refactor tests depending on Perl substitution operator Patrick Steinhardt
2025-03-25 14:35 ` Phillip Wood
2025-03-27 10:19 ` Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 12/20] t: refactor tests depending on Perl to print data Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 13/20] t: refactor tests depending on Perl for textconv scripts Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 14/20] t/lib-gpg: refactor `sanitize_pgp()` to not depend on Perl Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 15/20] t/lib-t6000: refactor `name_from_description()` " Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 16/20] t/lib-httpd: refactor "one-time-perl" CGI script " Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 17/20] t0021: refactor `generate_random_characters()` " Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 18/20] t0210: refactor trace2 scrubbing to not use Perl Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 19/20] t5316: refactor `max_chain()` to not depend on Perl Patrick Steinhardt
2025-03-25 13:14 ` [PATCH v2 20/20] t5703: refactor test " Patrick Steinhardt
2025-03-27 10:36 ` [PATCH v3 00/20] t: drop Perl as a mandatory prerequisite Patrick Steinhardt
2025-03-27 10:36 ` [PATCH v3 01/20] t: skip chain lint when PERL_PATH is unset Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 02/20] t: refactor environment sanitization to not use Perl Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 03/20] t: adapt character translation helpers " Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 04/20] t: adapt `test_copy_bytes()` " Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 05/20] t: adapt `test_readlink()` " Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 06/20] t: introduce PERL_TEST_HELPERS prerequisite Patrick Steinhardt
2025-04-01 18:26 ` Johannes Schindelin
2025-04-02 7:16 ` Patrick Steinhardt
2025-04-02 19:10 ` Johannes Schindelin
2025-04-03 5:05 ` Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 07/20] t: adapt existing PERL prerequisites Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 08/20] meson: stop requiring Perl when tests are enabled Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 09/20] Makefile: stop requiring Perl when running tests Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 10/20] t: refactor tests depending on Perl transliteration operator Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 11/20] t: refactor tests depending on Perl substitution operator Patrick Steinhardt
2025-04-01 18:32 ` Johannes Schindelin
2025-04-02 7:16 ` Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 12/20] t: refactor tests depending on Perl to print data Patrick Steinhardt
2025-04-01 18:35 ` Johannes Schindelin
2025-04-02 7:16 ` Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 13/20] t: refactor tests depending on Perl for textconv scripts Patrick Steinhardt
2025-04-01 18:55 ` Johannes Schindelin
2025-04-02 7:16 ` Patrick Steinhardt
2025-04-02 19:17 ` Johannes Schindelin
2025-03-27 10:37 ` [PATCH v3 14/20] t/lib-gpg: refactor `sanitize_pgp()` to not depend on Perl Patrick Steinhardt
2025-04-01 18:56 ` Johannes Schindelin [this message]
2025-04-02 7:16 ` Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 15/20] t/lib-t6000: refactor `name_from_description()` " Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 16/20] t/lib-httpd: refactor "one-time-perl" CGI script " Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 17/20] t0021: refactor `generate_random_characters()` " Patrick Steinhardt
2025-04-01 19:04 ` Johannes Schindelin
2025-04-02 7:16 ` Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 18/20] t0210: refactor trace2 scrubbing to not use Perl Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 19/20] t5316: refactor `max_chain()` to not depend on Perl Patrick Steinhardt
2025-03-27 10:37 ` [PATCH v3 20/20] t5703: refactor test " Patrick Steinhardt
2025-03-28 10:29 ` [PATCH v3 00/20] t: drop Perl as a mandatory prerequisite Phillip Wood
2025-04-02 19:32 ` Johannes Schindelin
2025-04-03 5:05 ` [PATCH v4 " Patrick Steinhardt
2025-04-03 5:05 ` [PATCH v4 01/20] t: skip chain lint when PERL_PATH is unset Patrick Steinhardt
2025-04-03 5:05 ` [PATCH v4 02/20] t: refactor environment sanitization to not use Perl Patrick Steinhardt
2025-04-03 5:05 ` [PATCH v4 03/20] t: adapt character translation helpers " Patrick Steinhardt
2025-04-03 5:05 ` [PATCH v4 04/20] t: adapt `test_copy_bytes()` " Patrick Steinhardt
2025-04-03 5:05 ` [PATCH v4 05/20] t: adapt `test_readlink()` " Patrick Steinhardt
2025-04-03 5:05 ` [PATCH v4 06/20] t: introduce PERL_TEST_HELPERS prerequisite Patrick Steinhardt
2025-04-03 5:05 ` [PATCH v4 07/20] t: adapt existing PERL prerequisites Patrick Steinhardt
2025-04-03 5:05 ` [PATCH v4 08/20] meson: stop requiring Perl when tests are enabled Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 09/20] Makefile: stop requiring Perl when running tests Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 10/20] t: refactor tests depending on Perl transliteration operator Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 11/20] t: refactor tests depending on Perl substitution operator Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 12/20] t: refactor tests depending on Perl to print data Patrick Steinhardt
2025-06-10 19:52 ` SZEDER Gábor
2025-06-10 21:31 ` Junio C Hamano
2025-07-07 9:53 ` Patrick Steinhardt
2025-06-10 21:44 ` Junio C Hamano
2025-04-03 5:06 ` [PATCH v4 13/20] t: refactor tests depending on Perl for textconv scripts Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 14/20] t/lib-gpg: refactor `sanitize_pgp()` to not depend on Perl Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 15/20] t/lib-t6000: refactor `name_from_description()` " Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 16/20] t/lib-httpd: refactor "one-time-perl" CGI script " Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 17/20] t0021: refactor `generate_random_characters()` " Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 18/20] t0210: refactor trace2 scrubbing to not use Perl Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 19/20] t5316: refactor `max_chain()` to not depend on Perl Patrick Steinhardt
2025-04-03 5:06 ` [PATCH v4 20/20] t5703: refactor test " Patrick Steinhardt
2025-04-03 12:12 ` [PATCH v4 00/20] t: drop Perl as a mandatory prerequisite Johannes Schindelin
2025-04-08 0:32 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c909b89f-7432-2d35-cfdb-0de9f94a7281@gmx.de \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
--cc=phillip.wood123@gmail.com \
--cc=ps@pks.im \
--cc=sunshine@sunshineco.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.
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 NNTP newsgroup(s).