There's no point in asking this over and over if the user already
properly configured his/her name and email.

Signed-off-by: Felipe Contreras <felipe.contre...@gmail.com>
---

I got really tired of 'git send-email' always asking me from which address to 
send mails... that's already configured.

 git-send-email.perl | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/git-send-email.perl b/git-send-email.perl
index aea66a0..65b8328 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -748,6 +748,17 @@ if (!$force) {
        }
 }
 
+my $name = Git::config('user.name');
+my $email = Git::config('user.email');
+
+if (defined $email) {
+       if (defined $name) {
+               $sender = sprintf("%s <%s>", $name, $email);
+       } else {
+               $sender = $email;
+       }
+}
+
 my $prompting = 0;
 if (!defined $sender) {
        $sender = $repoauthor || $repocommitter || '';
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to