git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Witten <mfwitten@MIT.EDU>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Michael Witten <mfwitten@mit.edu>
Subject: [PATCH 3/3][V.2] git-send-email: Better handling of EOF [^D]
Date: Sun,  3 Feb 2008 19:53:58 -0500	[thread overview]
Message-ID: <1202086438-16251-3-git-send-email-mfwitten@mit.edu> (raw)
In-Reply-To: <1202086438-16251-2-git-send-email-mfwitten@mit.edu>

Before, when the user sent the EOF control character,
the prompts would be repeated on the same line as the
previous prompt.

Now, repeat prompts display on separate lines.

Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
 git-send-email.perl |   46 +++++++++++++++++++++++++++++-----------------
 1 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 14268fc..6724810 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -376,9 +376,12 @@ if (@files) {
 my $prompting = 0;
 if (!defined $sender) {
 	$sender = $repoauthor || $repocommitter;
-	do {
+
+	while (1) {
 		$_ = $term->readline("Who should the emails appear to be from? [$sender] ");
-	} while (!defined $_);
+		last if defined $_;
+		print "\n";
+	}
 
 	$sender = $_ if ($_);
 	print "Emails will be sent from: ", $sender, "\n";
@@ -386,10 +389,14 @@ if (!defined $sender) {
 }
 
 if (!@to) {
-	do {
-		$_ = $term->readline("Who should the emails be sent to? ",
-				"");
-	} while (!defined $_);
+
+
+	while (1) {
+		$_ = $term->readline("Who should the emails be sent to? ", "");
+		last if defined $_;
+		print "\n";
+	}
+
 	my $to = $_;
 	push @to, split /,/, $to;
 	$prompting++;
@@ -411,20 +418,23 @@ sub expand_aliases {
 @bcclist = expand_aliases(@bcclist);
 
 if (!defined $initial_subject && $compose) {
-	do {
-		$_ = $term->readline("What subject should the initial email start with? ",
-			$initial_subject);
-	} while (!defined $_);
+	while (1) {
+		$_ = $term->readline("What subject should the initial email start with? ", $initial_subject);
+		last if defined $_;
+		print "\n";
+	}
+
 	$initial_subject = $_;
 	$prompting++;
 }
 
 if ($thread && !defined $initial_reply_to && $prompting) {
-	do {
-		$_= $term->readline("Message-ID to be used as In-Reply-To for the first email? ",
-			$initial_reply_to);
-	} while (!defined $_);
-
+	while (1) {
+		$_= $term->readline("Message-ID to be used as In-Reply-To for the first email? ", $initial_reply_to);
+		last if defined $_;
+		print "\n";
+	}
+	
 	$initial_reply_to = $_;
 }
 if (defined $initial_reply_to && $_ ne "") {
@@ -474,9 +484,11 @@ EOT
 	close(C);
 	close(C2);
 
-	do {
+	while (1) {
 		$_ = $term->readline("Send this email? (y|n) ");
-	} while (!defined $_);
+		last if defined $_;
+		print "\n";
+	}
 
 	if (uc substr($_,0,1) ne 'Y') {
 		cleanup_compose_files();
-- 
1.5.4.9.gcc769-dirty

      reply	other threads:[~2008-02-04  0:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01  4:59 [PATCH] git-send-email: ssh/login style password requests Michael Witten
2008-02-01 10:09 ` Junio C Hamano
2008-02-01 18:38   ` Michael Witten
2008-02-01 22:42     ` Michael Witten
2008-02-01 23:34       ` Junio C Hamano
2008-02-01 23:42         ` Michael Witten
2008-02-02  1:27           ` Junio C Hamano
2008-02-02  4:06             ` [PATCH 1/2][Perlers?] " Michael Witten
2008-02-02  4:06               ` [PATCH 2/2][Perlers?] git-send-email: SIG{TERM,INT} handlers Michael Witten
2008-02-02 21:31                 ` Junio C Hamano
2008-02-02 21:31               ` [PATCH 1/2][Perlers?] git-send-email: ssh/login style password requests Junio C Hamano
2008-02-03 17:59                 ` Michael Witten
2008-02-03 20:59                   ` Michael Witten
2008-02-04  0:53                     ` [PATCH 1/3][V.2] " Michael Witten
2008-02-04  0:53                       ` [PATCH 2/3][V.2] git-send-email: SIG{TERM,INT} handlers Michael Witten
2008-02-04  0:53                         ` Michael Witten [this message]

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

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

  git send-email \
    --in-reply-to=1202086438-16251-3-git-send-email-mfwitten@mit.edu \
    --to=mfwitten@mit.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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 NNTP newsgroup(s).