From: Taylor Blau <me@ttaylorr.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Jeff King <peff@peff.net>
Subject: Re: [PATCH v3 3/5] tests: replace [de]packetize() shell+perl test-tool pkt-line
Date: Wed, 14 Jul 2021 00:04:10 -0400 [thread overview]
Message-ID: <YO5iOqWx46UxdhKX@nand.local> (raw)
In-Reply-To: <patch-3.5-92bfd8a87b-20210714T005115Z-avarab@gmail.com>
On Wed, Jul 14, 2021 at 02:54:03AM +0200, Ævar Arnfjörð Bjarmason wrote:
> -extract_haves () {
> - depacketize | perl -lne '/^(\S+) \.have/ and print $1'
> -}
> -
> test_expect_success 'with core.alternateRefsCommand' '
> write_script fork/alternate-refs <<-\EOF &&
> git --git-dir="$1" for-each-ref \
> @@ -27,18 +23,40 @@ test_expect_success 'with core.alternateRefsCommand' '
> refs/heads/public/
> EOF
> test_config -C fork core.alternateRefsCommand ./alternate-refs &&
> - git rev-parse public/branch >expect &&
> - printf "0000" | git receive-pack fork >actual &&
> - extract_haves <actual >actual.haves &&
> - test_cmp expect actual.haves
> +
> + test-tool pkt-line pack >in <<-\EOF &&
> + 0000
> + EOF
> +
> + cat >expect <<-EOF &&
> + $(git rev-parse main) refs/heads/main
> + $(git rev-parse base) refs/tags/base
> + $(git rev-parse public) .have
> + 0000
> + EOF
> +
> + git receive-pack fork >out <in &&
> + test-tool pkt-line unpack <out >actual &&
I don't think extracting the haves themselves (and stripping ".have"
from the output) adds much verbosity at all. Wouldn't it be:
test-tool pkt-line unpack <out >actual &&
perl -lne '/^(\S+) \.have/ and print $1' <actual >actual.haves
(in fact, it might be quite nice to leave extract_haves as-is changing
depacketize for 'test-tool pkt-line unpack').
For what it's worth, I also don't care enough to argue about it, but I
am curious why the change here was more invasive compared to other
locations (where depacketize was just replaced with the earlier
incantation).
If memory serves, I am the original author of this test (via 89284c1d6c
(transport.c: introduce core.alternateRefsCommand, 2018-10-08)), but the
Perl bits are Peff's from the discussion in:
https://lore.kernel.org/git/20180922195258.GA20983@sigill.intra.peff.net/
Thanks,
Taylor
next prev parent reply other threads:[~2021-07-14 4:04 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-07 10:21 [PATCH 0/5] tests: migrate to "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 1/5] serve tests: add missing "extra delim" test Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 2/5] serve tests: use test_cmp in "protocol violations" test Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 3/5] tests: replace [de]packetize() shell+perl test-tool pkt-line Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 4/5] tests: replace remaining packetize() with "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 5/5] test-lib-functions.sh: remove unused [de]packetize() functions Ævar Arnfjörð Bjarmason
2021-07-12 16:44 ` [PATCH v2 0/5] tests: migrate to "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-12 16:44 ` [PATCH v2 1/5] serve tests: add missing "extra delim" test Ævar Arnfjörð Bjarmason
2021-07-12 16:44 ` [PATCH v2 2/5] serve tests: use test_cmp in "protocol violations" test Ævar Arnfjörð Bjarmason
2021-07-12 16:44 ` [PATCH v2 3/5] tests: replace [de]packetize() shell+perl test-tool pkt-line Ævar Arnfjörð Bjarmason
2021-07-13 20:50 ` Jeff King
2021-07-13 23:41 ` Ævar Arnfjörð Bjarmason
2021-07-14 1:12 ` Jeff King
2021-07-12 16:44 ` [PATCH v2 4/5] tests: replace remaining packetize() with "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-13 20:58 ` Jeff King
2021-07-13 23:52 ` Ævar Arnfjörð Bjarmason
2021-07-14 1:16 ` Jeff King
2021-07-12 16:44 ` [PATCH v2 5/5] test-lib-functions.sh: remove unused [de]packetize() functions Ævar Arnfjörð Bjarmason
2021-07-12 20:41 ` [PATCH v2 0/5] tests: migrate to "test-tool pkt-line" Junio C Hamano
2021-07-13 21:00 ` Jeff King
2021-07-14 0:54 ` [PATCH v3 " Ævar Arnfjörð Bjarmason
2021-07-14 0:54 ` [PATCH v3 1/5] serve tests: add missing "extra delim" test Ævar Arnfjörð Bjarmason
2021-07-14 0:54 ` [PATCH v3 2/5] serve tests: use test_cmp in "protocol violations" test Ævar Arnfjörð Bjarmason
2021-07-14 0:54 ` [PATCH v3 3/5] tests: replace [de]packetize() shell+perl test-tool pkt-line Ævar Arnfjörð Bjarmason
2021-07-14 4:04 ` Taylor Blau [this message]
2021-07-14 16:22 ` Junio C Hamano
2021-07-14 0:54 ` [PATCH v3 4/5] tests: replace remaining packetize() with "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-14 0:54 ` [PATCH v3 5/5] test-lib-functions.sh: remove unused [de]packetize() functions Ævar Arnfjörð Bjarmason
2021-07-16 15:41 ` [PATCH v4] test-lib-functions: use test-tool for [de]packetize() Ævar Arnfjörð Bjarmason
2021-07-16 16:53 ` Taylor Blau
2021-07-16 19:08 ` Jeff King
2021-07-16 19:03 ` Jeff King
2021-07-19 18:54 ` 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=YO5iOqWx46UxdhKX@nand.local \
--to=me@ttaylorr.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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).