send-email: error out when relogin delay is missing
authorStefan Beller <sbeller@google.com>
Mon, 12 Feb 2018 19:44:04 +0000 (11:44 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Feb 2018 20:43:03 +0000 (12:43 -0800)
When the batch size is neither configured nor given on the command
line, but the relogin delay is given, then the current code ignores
the relogin delay setting.

This is unsafe as there was some intention when setting the batch size.
One workaround would be to just assume a batch size of 1 as a default.
This however may be bad UX, as then the user may wonder why it is sending
slowly without apparent batching.

Error out for now instead of potentially confusing the user.
As 5453b83bdf (send-email: --batch-size to work around some SMTP
server limit, 2017-05-21) lays out, we rather want to not have this
interface anyway and would rather want to react on the server throttling
dynamically.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl
index 8a1ee0f0d43fdbc52b8257d973cb21063f318731..5bd689958eab2affa3f6fbe66e8ad0c7eb39fe1a 100755 (executable)
@@ -378,6 +378,10 @@ sub signal_handler {
 die __("Cannot run git format-patch from outside a repository\n")
        if $format_patch and not $repo;
 
+die __("`batch-size` and `relogin` must be specified together " .
+       "(via command-line or configuration option)\n")
+       if defined $relogin_delay and not defined $batch_size;
+
 # Now, let's fill any that aren't set in with defaults:
 
 sub read_config {