git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v3] git-send-email: use ! to indicate relative path to command
@ 2021-05-11 19:15 Gregory Anders
  2021-05-11 19:24 ` Jeff King
  2021-05-11 20:03 ` [PATCH v3] " Felipe Contreras
  0 siblings, 2 replies; 23+ messages in thread
From: Gregory Anders @ 2021-05-11 19:15 UTC (permalink / raw)
  To: git; +Cc: Gregory Anders

When the smtpServer config option is prefixed with a ! character, the
value of the option should be interpreted as a command to look up on
PATH.

Signed-off-by: Gregory Anders <greg@gpanders.com>
---

Remove the PATH lookup, since Perl's exec() does this already.

Thanks to Jeff King for the assist.

 git-send-email.perl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 175da07d94..022dcf0999 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1492,11 +1492,14 @@ sub send_message {
 
 	if ($dry_run) {
 		# We don't want to send the email.
-	} elsif (file_name_is_absolute($smtp_server)) {
+	} elsif (file_name_is_absolute($smtp_server) || $smtp_server =~ /^!/) {
+		my $prog = $smtp_server;
+		$prog =~ s/^!//;
+
 		my $pid = open my $sm, '|-';
 		defined $pid or die $!;
 		if (!$pid) {
-			exec($smtp_server, @sendmail_parameters) or die $!;
+			exec($prog, @sendmail_parameters) or die $!;
 		}
 		print $sm "$header\n$message";
 		close $sm or die $!;
-- 
2.31.1.576.g06d230b258


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

end of thread, other threads:[~2021-05-12  4:17 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 19:15 [PATCH v3] git-send-email: use ! to indicate relative path to command Gregory Anders
2021-05-11 19:24 ` Jeff King
2021-05-11 20:40   ` [PATCH v4] " Gregory Anders
2021-05-11 21:39     ` Jeff King
2021-05-11 22:18       ` Gregory Anders
2021-05-11 23:09     ` Junio C Hamano
2021-05-11 23:49     ` [PATCH v5] " Gregory Anders
2021-05-12  0:00       ` brian m. carlson
2021-05-12  0:35         ` Jeff King
2021-05-12  0:45           ` Gregory Anders
2021-05-12  0:49             ` Jeff King
2021-05-12  3:29             ` Junio C Hamano
2021-05-12  0:51           ` brian m. carlson
2021-05-11 20:03 ` [PATCH v3] " Felipe Contreras
2021-05-11 20:42   ` Gregory Anders
2021-05-11 22:07     ` Felipe Contreras
2021-05-11 22:19       ` Gregory Anders
2021-05-12  0:47         ` Jeff King
2021-05-12  1:08           ` Felipe Contreras
2021-05-12  1:24             ` Jeff King
2021-05-12  1:52               ` Felipe Contreras
2021-05-12  1:58                 ` Gregory Anders
2021-05-12  4:17                   ` Felipe Contreras

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).