Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-send-email: Better handling of EOF
author
Michael Witten
<mfwitten@MIT.EDU>
Mon, 4 Feb 2008 00:53:58 +0000
(19:53 -0500)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 5 Feb 2008 08:36:10 +0000
(
00:36
-0800)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
8742997
)
diff --git
a/git-send-email.perl
b/git-send-email.perl
index 14268fc1d4ea14b9052ad58386cf6de8385d3583..9d7c1f4671f69866a56d5c0b5be443d296e48eb5 100755
(executable)
--- a/
git-send-email.perl
+++ b/
git-send-email.perl
@@
-376,9
+376,12
@@
sub read_config {
my $prompting = 0;
if (!defined $sender) {
$sender = $repoauthor || $repocommitter;
my $prompting = 0;
if (!defined $sender) {
$sender = $repoauthor || $repocommitter;
- do {
+
+ while (1) {
$_ = $term->readline("Who should the emails appear to be from? [$sender] ");
$_ = $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";
$sender = $_ if ($_);
print "Emails will be sent from: ", $sender, "\n";
@@
-386,10
+389,14
@@
sub read_config {
}
if (!@to) {
}
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++;
my $to = $_;
push @to, split /,/, $to;
$prompting++;
@@
-411,19
+418,22
@@
sub expand_aliases {
@bcclist = expand_aliases(@bcclist);
if (!defined $initial_subject && $compose) {
@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) {
$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 = $_;
}
$initial_reply_to = $_;
}
@@
-474,9
+484,11
@@
sub expand_aliases {
close(C);
close(C2);
close(C);
close(C2);
-
do
{
+
while (1)
{
$_ = $term->readline("Send this email? (y|n) ");
$_ = $term->readline("Send this email? (y|n) ");
- } while (!defined $_);
+ last if defined $_;
+ print "\n";
+ }
if (uc substr($_,0,1) ne 'Y') {
cleanup_compose_files();
if (uc substr($_,0,1) ne 'Y') {
cleanup_compose_files();