All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] send-email config path expansion
@ 2015-11-17 22:01 John Keeping
  2015-11-17 22:01 ` [PATCH 1/2] send-email: expand path in sendemail.smtpsslcertpath config John Keeping
  2015-11-17 22:01 ` [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config John Keeping
  0 siblings, 2 replies; 7+ messages in thread
From: John Keeping @ 2015-11-17 22:01 UTC (permalink / raw)
  To: git; +Cc: John Keeping

These two patches enable tilde-expansion for a few more config variables
in git-send-email.

The first case is the one that surprised me when it didn't work, the
second two are the other ones that look like they should be handled as
paths.

John Keeping (2):
  send-email: expand path in sendemail.smtpsslcertpath config
  send-email: expand paths in sendemail.{to,cc}cmd config

 git-send-email.perl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.6.3.462.gbe2c914

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

* [PATCH 1/2] send-email: expand path in sendemail.smtpsslcertpath config
  2015-11-17 22:01 [PATCH 0/2] send-email config path expansion John Keeping
@ 2015-11-17 22:01 ` John Keeping
  2015-11-17 22:01 ` [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config John Keeping
  1 sibling, 0 replies; 7+ messages in thread
From: John Keeping @ 2015-11-17 22:01 UTC (permalink / raw)
  To: git; +Cc: John Keeping

As it says in the name, the SSL certificate path is a path so treat it
as one and support tilde-expansion.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 git-send-email.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index e907e0e..719c715 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -239,7 +239,6 @@ my %config_settings = (
     "smtpserveroption" => \@smtp_server_options,
     "smtpuser" => \$smtp_authuser,
     "smtppass" => \$smtp_authpass,
-    "smtpsslcertpath" => \$smtp_ssl_cert_path,
     "smtpdomain" => \$smtp_domain,
     "smtpauth" => \$smtp_auth,
     "to" => \@initial_to,
@@ -259,6 +258,7 @@ my %config_settings = (
 
 my %config_path_settings = (
     "aliasesfile" => \@alias_files,
+    "smtpsslcertpath" => \$smtp_ssl_cert_path,
 );
 
 # Handle Uncouth Termination
-- 
2.6.3.462.gbe2c914

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

* [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config
  2015-11-17 22:01 [PATCH 0/2] send-email config path expansion John Keeping
  2015-11-17 22:01 ` [PATCH 1/2] send-email: expand path in sendemail.smtpsslcertpath config John Keeping
@ 2015-11-17 22:01 ` John Keeping
  2015-11-24  0:04   ` Eric Sunshine
  1 sibling, 1 reply; 7+ messages in thread
From: John Keeping @ 2015-11-17 22:01 UTC (permalink / raw)
  To: git; +Cc: John Keeping

These configuration variables specify the paths to commands so we should
support tilde-expansion for files inside a user's home directory.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 git-send-email.perl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 719c715..8e4c0e1 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -242,9 +242,7 @@ my %config_settings = (
     "smtpdomain" => \$smtp_domain,
     "smtpauth" => \$smtp_auth,
     "to" => \@initial_to,
-    "tocmd" => \$to_cmd,
     "cc" => \@initial_cc,
-    "cccmd" => \$cc_cmd,
     "aliasfiletype" => \$aliasfiletype,
     "bcc" => \@bcclist,
     "suppresscc" => \@suppress_cc,
@@ -259,6 +257,8 @@ my %config_settings = (
 my %config_path_settings = (
     "aliasesfile" => \@alias_files,
     "smtpsslcertpath" => \$smtp_ssl_cert_path,
+    "tocmd" => \$to_cmd,
+    "cccmd" => \$cc_cmd,
 );
 
 # Handle Uncouth Termination
-- 
2.6.3.462.gbe2c914

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

* Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config
  2015-11-17 22:01 ` [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config John Keeping
@ 2015-11-24  0:04   ` Eric Sunshine
  2015-11-24  8:43     ` John Keeping
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Sunshine @ 2015-11-24  0:04 UTC (permalink / raw)
  To: John Keeping; +Cc: Git List

On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:
> These configuration variables specify the paths to commands so we should
> support tilde-expansion for files inside a user's home directory.

Hmm, I don't see anything in the documentation which says that these
are paths to commands, and the code itself treats them purely as
commands to be invoked, not as paths to commands. What is the
behavior, for instance, with --tocmd='foobar -x zopp' or even
--tocmd='foobar -x ~/zopp'?

> Signed-off-by: John Keeping <john@keeping.me.uk>
> ---
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 719c715..8e4c0e1 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -242,9 +242,7 @@ my %config_settings = (
>      "smtpdomain" => \$smtp_domain,
>      "smtpauth" => \$smtp_auth,
>      "to" => \@initial_to,
> -    "tocmd" => \$to_cmd,
>      "cc" => \@initial_cc,
> -    "cccmd" => \$cc_cmd,
>      "aliasfiletype" => \$aliasfiletype,
>      "bcc" => \@bcclist,
>      "suppresscc" => \@suppress_cc,
> @@ -259,6 +257,8 @@ my %config_settings = (
>  my %config_path_settings = (
>      "aliasesfile" => \@alias_files,
>      "smtpsslcertpath" => \$smtp_ssl_cert_path,
> +    "tocmd" => \$to_cmd,
> +    "cccmd" => \$cc_cmd,
>  );

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

* Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config
  2015-11-24  0:04   ` Eric Sunshine
@ 2015-11-24  8:43     ` John Keeping
  2015-11-24 22:23       ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: John Keeping @ 2015-11-24  8:43 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List

On Mon, Nov 23, 2015 at 07:04:46PM -0500, Eric Sunshine wrote:
> On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:
> > These configuration variables specify the paths to commands so we should
> > support tilde-expansion for files inside a user's home directory.
> 
> Hmm, I don't see anything in the documentation which says that these
> are paths to commands, and the code itself treats them purely as
> commands to be invoked, not as paths to commands. What is the
> behavior, for instance, with --tocmd='foobar -x zopp' or even
> --tocmd='foobar -x ~/zopp'?

The path behaviour only expands leading '~' and '~user' (as documented
in git-config(1)):

	$ git -c sendemail.tocmd='foobar -x ~/zopp' config --path sendemail.tocmd
	foobar -x ~/zopp

> > Signed-off-by: John Keeping <john@keeping.me.uk>
> > ---
> > diff --git a/git-send-email.perl b/git-send-email.perl
> > index 719c715..8e4c0e1 100755
> > --- a/git-send-email.perl
> > +++ b/git-send-email.perl
> > @@ -242,9 +242,7 @@ my %config_settings = (
> >      "smtpdomain" => \$smtp_domain,
> >      "smtpauth" => \$smtp_auth,
> >      "to" => \@initial_to,
> > -    "tocmd" => \$to_cmd,
> >      "cc" => \@initial_cc,
> > -    "cccmd" => \$cc_cmd,
> >      "aliasfiletype" => \$aliasfiletype,
> >      "bcc" => \@bcclist,
> >      "suppresscc" => \@suppress_cc,
> > @@ -259,6 +257,8 @@ my %config_settings = (
> >  my %config_path_settings = (
> >      "aliasesfile" => \@alias_files,
> >      "smtpsslcertpath" => \$smtp_ssl_cert_path,
> > +    "tocmd" => \$to_cmd,
> > +    "cccmd" => \$cc_cmd,
> >  );

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

* Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config
  2015-11-24  8:43     ` John Keeping
@ 2015-11-24 22:23       ` Jeff King
  2015-11-24 22:58         ` John Keeping
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff King @ 2015-11-24 22:23 UTC (permalink / raw)
  To: John Keeping; +Cc: Eric Sunshine, Git List

On Tue, Nov 24, 2015 at 08:43:53AM +0000, John Keeping wrote:

> On Mon, Nov 23, 2015 at 07:04:46PM -0500, Eric Sunshine wrote:
> > On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:
> > > These configuration variables specify the paths to commands so we should
> > > support tilde-expansion for files inside a user's home directory.
> > 
> > Hmm, I don't see anything in the documentation which says that these
> > are paths to commands, and the code itself treats them purely as
> > commands to be invoked, not as paths to commands. What is the
> > behavior, for instance, with --tocmd='foobar -x zopp' or even
> > --tocmd='foobar -x ~/zopp'?
> 
> The path behaviour only expands leading '~' and '~user' (as documented
> in git-config(1)):
> 
> 	$ git -c sendemail.tocmd='foobar -x ~/zopp' config --path sendemail.tocmd
> 	foobar -x ~/zopp

We usually run user-supplied commands with a shell (and AFAICT, that is
the case here). So wouldn't that turn into (when used by send-email):

  sh -c 'foobar -x ~/zopp'

and the shell would expand it for us? Running:

  git -c sendemail.tocmd='echo ~/foo' send-email -1

seems to work for me (it puts "/home/peff/foo" into the "to" header).

-Peff

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

* Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config
  2015-11-24 22:23       ` Jeff King
@ 2015-11-24 22:58         ` John Keeping
  0 siblings, 0 replies; 7+ messages in thread
From: John Keeping @ 2015-11-24 22:58 UTC (permalink / raw)
  To: Jeff King; +Cc: Eric Sunshine, Git List

On Tue, Nov 24, 2015 at 05:23:30PM -0500, Jeff King wrote:
> On Tue, Nov 24, 2015 at 08:43:53AM +0000, John Keeping wrote:
> 
> > On Mon, Nov 23, 2015 at 07:04:46PM -0500, Eric Sunshine wrote:
> > > On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:
> > > > These configuration variables specify the paths to commands so we should
> > > > support tilde-expansion for files inside a user's home directory.
> > > 
> > > Hmm, I don't see anything in the documentation which says that these
> > > are paths to commands, and the code itself treats them purely as
> > > commands to be invoked, not as paths to commands. What is the
> > > behavior, for instance, with --tocmd='foobar -x zopp' or even
> > > --tocmd='foobar -x ~/zopp'?
> > 
> > The path behaviour only expands leading '~' and '~user' (as documented
> > in git-config(1)):
> > 
> > 	$ git -c sendemail.tocmd='foobar -x ~/zopp' config --path sendemail.tocmd
> > 	foobar -x ~/zopp
> 
> We usually run user-supplied commands with a shell (and AFAICT, that is
> the case here). So wouldn't that turn into (when used by send-email):
> 
>   sh -c 'foobar -x ~/zopp'
> 
> and the shell would expand it for us? Running:
> 
>   git -c sendemail.tocmd='echo ~/foo' send-email -1
> 
> seems to work for me (it puts "/home/peff/foo" into the "to" header).

Ah, I hadn't tested it.  We can drop this patch then.

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

end of thread, other threads:[~2015-11-24 22:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-17 22:01 [PATCH 0/2] send-email config path expansion John Keeping
2015-11-17 22:01 ` [PATCH 1/2] send-email: expand path in sendemail.smtpsslcertpath config John Keeping
2015-11-17 22:01 ` [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config John Keeping
2015-11-24  0:04   ` Eric Sunshine
2015-11-24  8:43     ` John Keeping
2015-11-24 22:23       ` Jeff King
2015-11-24 22:58         ` John Keeping

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.