git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: sunshine@sunshineco.com
Cc: artagnon@gmail.com, avarab@gmail.com, git@vger.kernel.org,
	gitster@pobox.com, mina86@mina86.com, mst@kernel.org,
	pbonzini@redhat.com, sbeller@google.com, viktorin@rehivetech.com,
	zxq_yx_007@163.com
Subject: [PATCH] send-email: error out when relogin delay is missing
Date: Mon, 12 Feb 2018 11:44:04 -0800	[thread overview]
Message-ID: <20180212194404.66863-1-sbeller@google.com> (raw)
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


  reply	other threads:[~2018-02-12 19:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-21 12:59 [PATCH v5] send-email: --batch-size to work around some SMTP server limit xiaoqiang zhao
2017-05-22  2:14 ` Junio C Hamano
2017-05-22  3:19   ` Zhaoxiangqiang
2018-02-07 19:45   ` [PATCH] send-email: have default batch size when relogin delay is given Stefan Beller
2018-02-07 19:50     ` Eric Sunshine
2018-02-07 23:43       ` [PATCH] send-email: error out when relogin delay is missing Stefan Beller
2018-02-08  5:45         ` xiaoqiang zhao
2018-02-08  8:08         ` Eric Sunshine
2018-02-08 18:21           ` Stefan Beller
2018-02-08 22:00             ` Eric Sunshine
2018-02-12 19:44               ` Stefan Beller [this message]
2017-05-22  9:26 ` [PATCH v5] send-email: --batch-size to work around some SMTP server limit Ævar Arnfjörð Bjarmason
2017-05-23  7:46   ` Junio C Hamano
2017-05-23  8:30     ` Jan Viktorin
2017-05-23 12:55   ` 赵小强

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180212194404.66863-1-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=artagnon@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mina86@mina86.com \
    --cc=mst@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sunshine@sunshineco.com \
    --cc=viktorin@rehivetech.com \
    --cc=zxq_yx_007@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).