From: Junio C Hamano <gitster@pobox•com>
To: Robin Jarry <robin@jarry•cc>
Cc: git@vger•kernel.org, "Phillip Wood" <phillip.wood123@gmail•com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail•com>,
"Tim Culverhouse" <tim@timculverhouse•com>,
"Nicolas Dichtel" <nicolas.dichtel@6wind•com>,
"Bagas Sanjaya" <bagasdotme@gmail•com>,
"Eric Sunshine" <sunshine@sunshineco•com>,
"Michael Strawbridge" <michael.strawbridge@amd•com>
Subject: Re: [PATCH v2] send-email: export patch counters in validate environment
Date: Wed, 12 Apr 2023 14:48:21 -0700 [thread overview]
Message-ID: <xmqqsfd46aca.fsf@gitster.g> (raw)
In-Reply-To: <xmqqfs957zs4.fsf@gitster.g> (Junio C. Hamano's message of "Wed, 12 Apr 2023 10:53:31 -0700")
Junio C Hamano <gitster@pobox•com> writes:
> Overall, a very well crafted patch, even though little details and
> some design choices can be improved.
One thing I forgot to mention. We probably want some test, perhaps
adding something like the following to t9001 after we already test
for --validate.
Thanks.
----------- >8 ---------------------- >8 ---------------------- >8 -----------
expected_file_counter_output () {
total=$1
count=0
while test $count -ne $total
do
count=$((count + 1)) &&
echo "$count/$total" || return
done
}
test_expect_success $PREREQ '--validate hook allows counting of messages' '
test_when_finished "rm my-hooks.log" &&
test_config core.hooksPath "my-hooks" &&
write_script my-hooks/sendemail-validate <<-\EOF &&
num=$GIT_SENDEMAIL_FILE_COUNTER &&
tot=$GIT_SENDEMAIL_FILE_TOTAL &&
echo "$num/$tot" >>my-hooks.log || exit 1
EOF
>my-hooks.log &&
expected_file_counter_output 1 >expect &&
git send-email \
--from="Example <from@example•com>" \
--to=nobody@example•com \
--smtp-server="$(pwd)/fake.sendmail" \
--validate $patches &&
test_cmp expect my-hooks.log
'
next prev parent reply other threads:[~2023-04-12 21:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 11:47 [PATCH] send-email: export patch counters in validate environment Robin Jarry
2023-04-11 13:23 ` Phillip Wood
2023-04-11 16:28 ` Junio C Hamano
2023-04-11 17:13 ` Robin Jarry
2023-04-11 19:14 ` Junio C Hamano
2023-04-11 16:47 ` Robin Jarry
2023-04-12 9:54 ` [PATCH v2] " Robin Jarry
2023-04-12 17:53 ` Junio C Hamano
2023-04-12 18:33 ` Robin Jarry
2023-04-12 20:37 ` Junio C Hamano
2023-04-12 20:39 ` Robin Jarry
2023-04-12 21:48 ` Junio C Hamano [this message]
2023-04-12 21:45 ` [PATCH v3] " Robin Jarry
2023-04-13 13:52 ` Phillip Wood
2023-04-13 14:01 ` Robin Jarry
2023-04-14 12:58 ` Phillip Wood
2023-04-14 15:28 ` [PATCH v4] " Robin Jarry
2023-04-14 15:50 ` Robin Jarry
2023-04-14 15:52 ` [PATCH v5] " Robin Jarry
2023-04-20 19:16 ` Robin Jarry
2023-04-20 19:25 ` 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=xmqqsfd46aca.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=avarab@gmail$(echo .)com \
--cc=bagasdotme@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=michael.strawbridge@amd$(echo .)com \
--cc=nicolas.dichtel@6wind$(echo .)com \
--cc=phillip.wood123@gmail$(echo .)com \
--cc=robin@jarry$(echo .)cc \
--cc=sunshine@sunshineco$(echo .)com \
--cc=tim@timculverhouse$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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