From: Junio C Hamano <gitster@pobox.com>
To: AbdAlRahman Gad <abdobngad@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH][Newcomer] t7004-tag: modernize the test script
Date: Sat, 03 Aug 2024 09:29:40 -0700 [thread overview]
Message-ID: <xmqqmslt7eob.fsf@gitster.g> (raw)
In-Reply-To: <dcded6a3-e284-4d52-b36f-dacc056bbc5b@gmail.com> (AbdAlRahman Gad's message of "Sat, 3 Aug 2024 17:34:46 +0300")
AbdAlRahman Gad <abdobngad@gmail.com> writes:
>> It is a good start. There are other modernization opportunities in
>> this file, though.
>> - Output from "test-tool ref-store" piped to "sed" means the exit
>> status from an abnormal exit of "test-tool" is hidden. They
>> should be split into two commands.
>> - Expected output file prepared outside test_expect_success that
>> uses it.
>> - Here-doc that does not interpolate leaving the EOF marker
>> unquoted.
>
> Thanks for the review. I've just sent a follow-up v2 patch fixing the
> things you mentioned. I also found other issues like:
>
> some test_expect_success are seperated from its name like:
>
> test_expect_success \
> 'trying to delete tags without params should succeed and do nothing' '
>
> but I preferred to send the patch first as it was getting very long
> and I also wanted to make sure that I am on the right path and not
> just fixing unrelated things.
To deal with "is this getting too long?" you can split this into a
series of multiple patches, e.g.
[PATCH 0/n] t7004: modernize the style
cover letter that gives an overview of the series
[PATCH 1/n] t7004: description on the same line as test_expect_success
the one you pointed out above
[PATCH 2/n] t7004: redirection operator
the patch you sent earlier
[PATCH 3/n] t7004: do not lose exit status to pipe
split "test-tool ... | sed" pipeline into two commands
to avoid losing exit status from test-tool
[PATCH 4/n] t7004: one command per line
fix lines like these:
git tag -l >actual && test_cmp expect actual &&
to
git tag -l >actual &&
test_cmp expect actual &&
[PATCH 5/n] t7004: here-doc modernization
use <<-EOF or <<-\EOF to indent here-doc
use \EOF not EOF when not interpolating
[PATCH 6/n] t7004: do not do things outside test_expect_success
do not prepare expect and other things outside test_expect_success
would make a thorough series, while keeping each step still
reasonably short, I suspect.
prev parent reply other threads:[~2024-08-03 16:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 6:47 [PATCH][Newcomer] t7004-tag: modernize the test script AbdAlRahman Gad
2024-08-02 16:05 ` Junio C Hamano
2024-08-03 14:34 ` AbdAlRahman Gad
2024-08-03 16:29 ` Junio C Hamano [this message]
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=xmqqmslt7eob.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=abdobngad@gmail.com \
--cc=git@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.