Skip to contentSkip to conversation

git-send-email: Document support for local sendmail instead of SMTP server

PATCH In review Sergey Vlasov 2 participants 4 messages Aug 11, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 git-send-email: Document support for local sendmail instead of SMTP server

Fix the --smtp-server option description to match reality.

---
 Documentation/git-send-email.txt |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Documentation/git-send-email.txt +5 -2
index 481b3f5..ec0e201 100644
@@ -66,8 +66,11 @@ The options available are:
 	all that is output.
 
 --smtp-server::
-	If set, specifies the outgoing SMTP server to use.  Defaults to
-	localhost.
+	If set, specifies the outgoing SMTP server to use.  A full
+	pathname of a sendmail-like program can be specified instead;
+	the program must support the `-i` option.  Defaults to
+	`/usr/sbin/sendmail` or `/usr/lib/sendmail` if such program is
+	available, or to `localhost` otherwise.
 
 --subject::
    	Specify the initial subject of the email thread.
Signature · 1 line
1.4.3.3.ge502
#2 lore raw

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

In reply to Sergey Vlasov

Make the default value for --smtp-server configurable through the 'sendemail.smtpserver' option in .git/config (or $HOME/.gitconfig).

---
 Documentation/git-send-email.txt |    8 +++++---
 git-send-email.perl              |    3 +++
 2 files changed, 8 insertions(+), 3 deletions(-)
Documentation/git-send-email.txt +5 -3
index ec0e201..4c8d907 100644
@@ -68,9 +68,11 @@ The options available are:
 --smtp-server::
 	If set, specifies the outgoing SMTP server to use.  A full
 	pathname of a sendmail-like program can be specified instead;
-	the program must support the `-i` option.  Defaults to
-	`/usr/sbin/sendmail` or `/usr/lib/sendmail` if such program is
-	available, or to `localhost` otherwise.
+	the program must support the `-i` option.  Default value can
+	be specified by the 'sendemail.smtpserver' configuration
+	option; the built-in default is `/usr/sbin/sendmail` or
+	`/usr/lib/sendmail` if such program is available, or
+	`localhost` otherwise.
 
 --subject::
    	Specify the initial subject of the email thread.
git-send-email.perl +3 -0
index c42dc3b..4c87c20 100755
@@ -231,6 +231,9 @@ if (!defined $initial_reply_to && $promp
 }
 
 if (!$smtp_server) {
+	$smtp_server = $repo->config('sendemail.smtpserver');
+}
+if (!$smtp_server) {
 	foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
 		if (-x $_) {
 			$smtp_server = $_;
Signature · 1 line
1.4.3.3.ge502
#3 lore raw

Re: [PATCH 2/2] git-send-email: Read the default SMTP server from the GIT config file

Quoted 4 lines · Sergey Vlasov

Make the default value for --smtp-server configurable through the 'sendemail.smtpserver' option in .git/config (or $HOME/.gitconfig).