git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-1.4.4.3, also 1.5.0rc0: send-email gets empty From:
@ 2006-12-27 13:43 Horst H. von Brand
  2006-12-27 14:16 ` [PATCH] git-send-email: default value for "From:" field Quy Tonthat
  0 siblings, 1 reply; 4+ messages in thread
From: Horst H. von Brand @ 2006-12-27 13:43 UTC (permalink / raw)
  To: git

I updated a local project, git-format-patch:ed, and then:

  $ git send-email --to=olpc@listas.inf.utfsm.cl --no-signed-off-by-cc /tmp/0001-Add-myself-to-AUTHORS.txt
  Who should the emails appear to be from? 
  Emails will be sent from: 
  Message-ID to be used as In-Reply-To for the first email? 
  /tmp/0001-Add-myself-to-AUTHORS.txt
  Use of uninitialized value in concatenation (.) or string at /usr/bin/git-send-email line 392.
  (mbox) Adding cc: Horst H. von Brand <vonbrand@inf.utfsm.cl> from line 'From: Horst H. von Brand <vonbrand@inf.utfsm.cl>'
  OK. Log says:
  Date: Wed, 27 Dec 2006 10:27:39 -0300
  Sendmail: /usr/sbin/sendmail
  From: 
  Subject: [PATCH] Add myself to AUTHORS
  Cc: Horst H. von Brand <vonbrand@inf.utfsm.cl>
  To: olpc@listas.inf.utfsm.cl

  Result: OK

I didn't add a From:, per manpage it is assumed to be GIT_COMMITER_IDENT
(from 'git-var -l' this is 'Horst H. von Brand <vonbrand@inf.utfsm.cl> 1167226309 -0300').
Note particularly the "Emails will be sent from:" line!

The resulting message is formed right (it has a From: header), so this is
just a UI glitch.

The same output from 1.5.0rc0 here.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                    Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria             +56 32 2654239
Casilla 110-V, Valparaiso, Chile               Fax:  +56 32 2797513

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] git-send-email: default value for "From:" field.
  2006-12-27 13:43 git-1.4.4.3, also 1.5.0rc0: send-email gets empty From: Horst H. von Brand
@ 2006-12-27 14:16 ` Quy Tonthat
  2007-01-18 20:39   ` Timur Tabi
  0 siblings, 1 reply; 4+ messages in thread
From: Quy Tonthat @ 2006-12-27 14:16 UTC (permalink / raw)
  To: Horst H. von Brand; +Cc: git

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] git-send-email: default value for "From:" field.
  2006-12-27 14:16 ` [PATCH] git-send-email: default value for "From:" field Quy Tonthat
@ 2007-01-18 20:39   ` Timur Tabi
  2007-01-19  1:14     ` Quy Tonthat
  0 siblings, 1 reply; 4+ messages in thread
From: Timur Tabi @ 2007-01-18 20:39 UTC (permalink / raw)
  To: Quy Tonthat; +Cc: Horst H. von Brand, git

Quy Tonthat wrote:
> 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 ?

I was thinking the same thing.  Almost every call to readline() in 
git-send-email is like that, so could your patch below could be expanded to 
include the other instances?

         $_ = $term->readline("Who should the emails be sent to? ",
                         "");

         $_ = $term->readline("What subject should the emails start with? ",
                 $initial_subject);

         $_= $term->readline("Message-ID to be used as In-Reply-To for the first 
email? ",
                 $initial_reply_to);

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] git-send-email: default value for "From:" field.
  2007-01-18 20:39   ` Timur Tabi
@ 2007-01-19  1:14     ` Quy Tonthat
  0 siblings, 0 replies; 4+ messages in thread
From: Quy Tonthat @ 2007-01-19  1:14 UTC (permalink / raw)
  To: Timur Tabi; +Cc: Horst H. von Brand, git

Timur Tabi wrote:
> Quy Tonthat wrote:
>> 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 ?
> 
> I was thinking the same thing.  Almost every call to readline() in
> git-send-email is like that, so could your patch below could be expanded
> to include the other instances?
> 
>         $_ = $term->readline("Who should the emails be sent to? ",
>                         "");
> 
>         $_ = $term->readline("What subject should the emails start with? ",
>                 $initial_subject);
> 
>         $_= $term->readline("Message-ID to be used as In-Reply-To for
> the first email? ",
>                 $initial_reply_to);
> 
It is correct to expand the fix to other instances, but that won't practically
change anything at run time (All those "defaults" are empty when passed to readline).
I don't normally change somebody else's codes just for the sake of correctness or styles.
Quy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-19  1:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-27 13:43 git-1.4.4.3, also 1.5.0rc0: send-email gets empty From: Horst H. von Brand
2006-12-27 14:16 ` [PATCH] git-send-email: default value for "From:" field Quy Tonthat
2007-01-18 20:39   ` Timur Tabi
2007-01-19  1:14     ` Quy Tonthat

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).