Junio C Hamano <gitster@xxxxxxxxx> 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@xxxxxxxxxxx>" \ --to=nobody@xxxxxxxxxxx \ --smtp-server="$(pwd)/fake.sendmail" \ --validate $patches && test_cmp expect my-hooks.log '