[PATCH] git-send-email: default value for "From:" field.
- From
- Quy Tonthat <qtonthat@gmail.com>
- Date
- Dec 27, 2006, 14:16 UTC
- Message-ID
- <45928035.6000605@gmail.com>
- In-Reply-To
- <200612271343.kBRDhKfA009927@laptop13.inf.utfsm.cl>
If user hits enter at the prompt for "Who should the emails appear to be from?", the value for "From:" field was emptied instead of GIT_COMMITER_IDENT.
Signed-off-by: Quy Tonthat <qtonthat@gmail.com> --- It seems the original code assumes readline to accept an extra argument for default value. I don't remember I ever encountered that feature from readline. Is there anything like that out there ?
git-send-email.perl | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl index 4c87c20..ba39d39 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -178,11 +178,10 @@ my $prompting = 0; if (!defined $from) { $from = $author || $committer; do { - $_ = $term->readline("Who should the emails appear to be from? ", - $from); + $_ = $term->readline("Who should the emails appear to be from? [$from] "); } while (!defined $_); - $from = $_; + $from = $_ if ($_); print "Emails will be sent from: ", $from, "\n"; $prompting++; }
-- 1.4.4.3.q5