git-send-email: improve --validate error output
commitea7811b37e0e6fabb2a410475f198eab33110dcf
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 6 Apr 2021 14:00:37 +0000 (6 16:00 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Apr 2021 19:57:06 +0000 (6 12:57 -0700)
tree2d8c56deabe9a57a1da218783e714484cadc170a
parentd21616c0394d3339c619409995e48b8cbc0f4e08
git-send-email: improve --validate error output

Improve the output we emit on --validate error to:

 * Say "FILE:LINE" instead of "FILE: LINE", to match "grep -n",
   compiler error messages etc.

 * Don't say "patch contains a" after just mentioning the filename,
   just leave it at "FILE:LINE: is longer than[...]. The "contains a"
   sounded like we were talking about the file in general, when we're
   actually checking it line-by-line.

 * Don't just say "rejected by sendemail-validate hook", but combine
   that with the system_or_msg() output to say what exit code the hook
   died with.

I had an aborted attempt to make the line length checker note all
lines that were longer than the limit. I didn't think that was worth
the effort, but I've left in the testing change to check that we die
as soon as we spot the first long line.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl
t/t9001-send-email.sh