git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] send-email: error out when relogin delay is missing

From
Stefan Beller <sbeller@google.com>
Date
Feb 12, 2018, 19:44 UTC
Message-ID
<20180212194404.66863-1-sbeller@google.com>
In-Reply-To
<CAPig+cRyx1KHJMn97mNy_BmX1D+cGEqVUT6x3Bw+tmsUOE3J+w@mail.gmail.com>

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>
---
 git-send-email.perl | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/git-send-email.perl b/git-send-email.perl
index 340b5c8482..f7913f7c2c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -379,6 +379,10 @@ unless ($rc) {
 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 {
-- 
2.15.1.433.g936d1b9894.dirty
Previous: Eric SunshineNext: Ævar Arnfjörð Bjarmason
Message 11 of 15 in “send-email: --batch-size to work around some SMTP server limit”
  1. send-email: --batch-size to work around some SMTP server limitxiaoqiang zhao, May 21, 2017
  2. Junio C HamanoMay 22, 2017
  3. ZhaoxiangqiangMay 22, 2017
  4. send-email: have default batch size when relogin delay is givenStefan Beller, Feb 7, 2018
  5. Eric SunshineFeb 7, 2018
  6. send-email: error out when relogin delay is missingStefan Beller, Feb 7, 2018
  7. xiaoqiang zhaoFeb 8, 2018
  8. Eric SunshineFeb 8, 2018
  9. Stefan BellerFeb 8, 2018
  10. Eric SunshineFeb 8, 2018
  11. send-email: error out when relogin delay is missingStefan Beller, Feb 12, 2018
  12. Ævar Arnfjörð BjarmasonMay 22, 2017
  13. Junio C HamanoMay 23, 2017
  14. Jan ViktorinMay 23, 2017
  15. 赵小强May 23, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.