@matheusbsbs / matheus-bagliano / commits / 6dcfa306f2
Fork 0

git-send-email: Read the default SMTP server from the GIT config file

Make the default value for --smtp-server configurable through the 'sendemail.smtpserver' option in .git/config (or $HOME/.gitconfig). Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Acked-by: Ryan Anderson <rda@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Sergey Vlasov committed Oct 29, 2006 at 22:31 UTC 6dcfa306f2b67b733a7eb2d7ded1bc9987809edb
2 files changed +8 -3
Documentation/git-send-email.txt
+5 -3
@@ -68,9 +68,11 @@ The options available are:
68 --smtp-server::
69 If set, specifies the outgoing SMTP server to use. A full
70 pathname of a sendmail-like program can be specified instead;
71 - the program must support the `-i` option. Defaults to
72 - `/usr/sbin/sendmail` or `/usr/lib/sendmail` if such program is
73 - available, or to `localhost` otherwise.
71 + the program must support the `-i` option. Default value can
72 + be specified by the 'sendemail.smtpserver' configuration
73 + option; the built-in default is `/usr/sbin/sendmail` or
74 + `/usr/lib/sendmail` if such program is available, or
75 + `localhost` otherwise.
76
77 --subject::
78 Specify the initial subject of the email thread.
git-send-email.perl
+3
@@ -230,6 +230,9 @@ if (!defined $initial_reply_to && $prompting) {
230 $initial_reply_to =~ s/(^\s+|\s+$)//g;
231 }
232
233 +if (!$smtp_server) {
234 + $smtp_server = $repo->config('sendemail.smtpserver');
235 +}
236 if (!$smtp_server) {
237 foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
238 if (-x $_) {