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

Re: [PATCH] send-mail: Add option to sleep between sending each email.

From
Georgi Chorbadzhiyski <gf@unixsol.org>
Date
Sep 8, 2011, 14:07 UTC
Message-ID
<4E68CC08.4040201@unixsol.org>
In-Reply-To
<4E68CA0C.5080702@unixsol.org>
Around 09/08/2011 04:58 PM, Georgi Chorbadzhiyski scribbled:
Show 32 quoted lines
> Around 09/08/2011 02:15 PM, Matthieu Moy scribbled:
>> [1] Actually, I think there's a problem with Georgi's patch. If I read
>> correctly, the sleep is inserted within the confirmation loop, which
>> means the user will have
>>
>> send this email? yes
>> sending email
>> sleeping 10 seconds
>> send this email? yes
>> sending email
>> sleeping 10 seconds
>> ...
>>
>> while it should be
>>
>> send this email? yes
>> ok, I'll send it later
>> send this email? yes
>> ok, I'll send it later
>> sending first email ...
>> sleeping 10 seconds
>> sending second email
>> done.
>>
>> (i.e. don't force the user to wait between confirmations, and don't wait
>> after the last email)
> 
> In order for this to work, confirmation should be split from send_message()
> and from a quick look this not seem very easy. Might be easier to just
> disable the sleep if user was asked for confirmation. It'll be good to
> not sleep after last email, but main "foreach my $t (@files) {" loop should
> pass some hint to send_message().

The attached patch (apply on on top of the original) should implement the idea.

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/


diff --git a/git-send-email.perl b/git-send-email.perl
index 7239fd4..d4559c9 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1149,7 +1149,7 @@ X-Mailer: git-send-email $gitversion
 		}
 	}
 
-	if (!$dry_run && $sleep) {
+	if (!$dry_run && $sleep && $message_num < scalar $#files && $confirm eq 'never') {
 		print "Sleeping: $sleep second(s).\n" if (!$quiet);
 		sleep($sleep);
 	};
Previous: Georgi ChorbadzhiyskiNext: Jakub Narebski
Message 10 of 17 in “send-mail: Add option to sleep between sending each email.”
  1. send-mail: Add option to sleep between sending each email.Georgi Chorbadzhiyski, Sep 7, 2011
  2. Ramkumar RamachandraSep 8, 2011
  3. Matthieu MoySep 8, 2011
  4. Ramkumar RamachandraSep 8, 2011
  5. Ramkumar RamachandraSep 8, 2011
  6. Ramkumar RamachandraSep 8, 2011
  7. Georgi ChorbadzhiyskiSep 8, 2011
  8. Matthieu MoySep 8, 2011
  9. Georgi ChorbadzhiyskiSep 8, 2011
  10. Georgi ChorbadzhiyskiSep 8, 2011
  11. Jakub NarebskiOct 3, 2011
  12. Georgi ChorbadzhiyskiSep 8, 2011
  13. Junio C HamanoSep 8, 2011
  14. Matthieu MoySep 8, 2011
  15. mfwitten@gmail.comSep 9, 2011
  16. Ramkumar RamachandraSep 12, 2011
  17. Georgi ChorbadzhiyskiSep 8, 2011

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.