{"thread":{"id":"40817","subject":"[PATCH 0/2] send-email config path expansion","startedAt":"2015-11-17T22:01:04Z","lastAt":"2015-11-24T22:58:24Z","messageCount":7,"participants":["John Keeping","Eric Sunshine","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"273447","messageId":"cover.1447797487.git.john@keeping.me.uk","threadId":"40817","inReplyTo":null,"subject":"[PATCH 0/2] send-email config path expansion","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-11-17T22:01:04Z","receivedAt":"2015-11-17T22:01:04Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"These two patches enable tilde-expansion for a few more config variables\nin git-send-email.\n\nThe first case is the one that surprised me when it didn't work, the\nsecond two are the other ones that look like they should be handled as\npaths.\n\nJohn Keeping (2):\n  send-email: expand path in sendemail.smtpsslcertpath config\n  send-email: expand paths in sendemail.{to,cc}cmd config\n\n git-send-email.perl | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\n-- \n2.6.3.462.gbe2c914\n"},{"id":"273460","messageId":"5b9c60c07329ee166409f9d7f0b2ad4ad6e2dca3.1447797487.git.john@keeping.me.uk","threadId":"40817","inReplyTo":"cover.1447797487.git.john@keeping.me.uk","subject":"[PATCH 1/2] send-email: expand path in sendemail.smtpsslcertpath config","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-11-17T22:01:05Z","receivedAt":"2015-11-17T22:01:05Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"As it says in the name, the SSL certificate path is a path so treat it\nas one and support tilde-expansion.\n\nSigned-off-by: John Keeping <john@keeping.me.uk>\n---\n git-send-email.perl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e907e0e..719c715 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -239,7 +239,6 @@ my %config_settings = (\n     \"smtpserveroption\" => \\@smtp_server_options,\n     \"smtpuser\" => \\$smtp_authuser,\n     \"smtppass\" => \\$smtp_authpass,\n-    \"smtpsslcertpath\" => \\$smtp_ssl_cert_path,\n     \"smtpdomain\" => \\$smtp_domain,\n     \"smtpauth\" => \\$smtp_auth,\n     \"to\" => \\@initial_to,\n@@ -259,6 +258,7 @@ my %config_settings = (\n \n my %config_path_settings = (\n     \"aliasesfile\" => \\@alias_files,\n+    \"smtpsslcertpath\" => \\$smtp_ssl_cert_path,\n );\n \n # Handle Uncouth Termination\n-- \n2.6.3.462.gbe2c914\n"},{"id":"273458","messageId":"db0b817c4be57635248a48a529a32719ad232f02.1447797487.git.john@keeping.me.uk","threadId":"40817","inReplyTo":"cover.1447797487.git.john@keeping.me.uk","subject":"[PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-11-17T22:01:06Z","receivedAt":"2015-11-17T22:01:06Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"These configuration variables specify the paths to commands so we should\nsupport tilde-expansion for files inside a user's home directory.\n\nSigned-off-by: John Keeping <john@keeping.me.uk>\n---\n git-send-email.perl | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 719c715..8e4c0e1 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -242,9 +242,7 @@ my %config_settings = (\n     \"smtpdomain\" => \\$smtp_domain,\n     \"smtpauth\" => \\$smtp_auth,\n     \"to\" => \\@initial_to,\n-    \"tocmd\" => \\$to_cmd,\n     \"cc\" => \\@initial_cc,\n-    \"cccmd\" => \\$cc_cmd,\n     \"aliasfiletype\" => \\$aliasfiletype,\n     \"bcc\" => \\@bcclist,\n     \"suppresscc\" => \\@suppress_cc,\n@@ -259,6 +257,8 @@ my %config_settings = (\n my %config_path_settings = (\n     \"aliasesfile\" => \\@alias_files,\n     \"smtpsslcertpath\" => \\$smtp_ssl_cert_path,\n+    \"tocmd\" => \\$to_cmd,\n+    \"cccmd\" => \\$cc_cmd,\n );\n \n # Handle Uncouth Termination\n-- \n2.6.3.462.gbe2c914\n"},{"id":"273626","messageId":"CAPig+cRY3W4VMgqnRuQFeMk7oueKsA=ZhMAk15LLyZg0KfVvCA@mail.gmail.com","threadId":"40817","inReplyTo":"db0b817c4be57635248a48a529a32719ad232f02.1447797487.git.john@keeping.me.uk","subject":"Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-11-24T00:04:46Z","receivedAt":"2015-11-24T00:04:46Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:\n> These configuration variables specify the paths to commands so we should\n> support tilde-expansion for files inside a user's home directory.\n\nHmm, I don't see anything in the documentation which says that these\nare paths to commands, and the code itself treats them purely as\ncommands to be invoked, not as paths to commands. What is the\nbehavior, for instance, with --tocmd='foobar -x zopp' or even\n--tocmd='foobar -x ~/zopp'?\n\n> Signed-off-by: John Keeping <john@keeping.me.uk>\n> ---\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 719c715..8e4c0e1 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -242,9 +242,7 @@ my %config_settings = (\n>      \"smtpdomain\" => \\$smtp_domain,\n>      \"smtpauth\" => \\$smtp_auth,\n>      \"to\" => \\@initial_to,\n> -    \"tocmd\" => \\$to_cmd,\n>      \"cc\" => \\@initial_cc,\n> -    \"cccmd\" => \\$cc_cmd,\n>      \"aliasfiletype\" => \\$aliasfiletype,\n>      \"bcc\" => \\@bcclist,\n>      \"suppresscc\" => \\@suppress_cc,\n> @@ -259,6 +257,8 @@ my %config_settings = (\n>  my %config_path_settings = (\n>      \"aliasesfile\" => \\@alias_files,\n>      \"smtpsslcertpath\" => \\$smtp_ssl_cert_path,\n> +    \"tocmd\" => \\$to_cmd,\n> +    \"cccmd\" => \\$cc_cmd,\n>  );\n"},{"id":"273636","messageId":"20151124084353.GH21488@serenity.lan","threadId":"40817","inReplyTo":"CAPig+cRY3W4VMgqnRuQFeMk7oueKsA=ZhMAk15LLyZg0KfVvCA@mail.gmail.com","subject":"Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-11-24T08:43:53Z","receivedAt":"2015-11-24T08:43:53Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Mon, Nov 23, 2015 at 07:04:46PM -0500, Eric Sunshine wrote:\n> On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:\n> > These configuration variables specify the paths to commands so we should\n> > support tilde-expansion for files inside a user's home directory.\n> \n> Hmm, I don't see anything in the documentation which says that these\n> are paths to commands, and the code itself treats them purely as\n> commands to be invoked, not as paths to commands. What is the\n> behavior, for instance, with --tocmd='foobar -x zopp' or even\n> --tocmd='foobar -x ~/zopp'?\n\nThe path behaviour only expands leading '~' and '~user' (as documented\nin git-config(1)):\n\n\t$ git -c sendemail.tocmd='foobar -x ~/zopp' config --path sendemail.tocmd\n\tfoobar -x ~/zopp\n\n> > Signed-off-by: John Keeping <john@keeping.me.uk>\n> > ---\n> > diff --git a/git-send-email.perl b/git-send-email.perl\n> > index 719c715..8e4c0e1 100755\n> > --- a/git-send-email.perl\n> > +++ b/git-send-email.perl\n> > @@ -242,9 +242,7 @@ my %config_settings = (\n> >      \"smtpdomain\" => \\$smtp_domain,\n> >      \"smtpauth\" => \\$smtp_auth,\n> >      \"to\" => \\@initial_to,\n> > -    \"tocmd\" => \\$to_cmd,\n> >      \"cc\" => \\@initial_cc,\n> > -    \"cccmd\" => \\$cc_cmd,\n> >      \"aliasfiletype\" => \\$aliasfiletype,\n> >      \"bcc\" => \\@bcclist,\n> >      \"suppresscc\" => \\@suppress_cc,\n> > @@ -259,6 +257,8 @@ my %config_settings = (\n> >  my %config_path_settings = (\n> >      \"aliasesfile\" => \\@alias_files,\n> >      \"smtpsslcertpath\" => \\$smtp_ssl_cert_path,\n> > +    \"tocmd\" => \\$to_cmd,\n> > +    \"cccmd\" => \\$cc_cmd,\n> >  );\n"},{"id":"273664","messageId":"20151124222330.GF29185@sigill.intra.peff.net","threadId":"40817","inReplyTo":"20151124084353.GH21488@serenity.lan","subject":"Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-11-24T22:23:30Z","receivedAt":"2015-11-24T22:23:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Nov 24, 2015 at 08:43:53AM +0000, John Keeping wrote:\n\n> On Mon, Nov 23, 2015 at 07:04:46PM -0500, Eric Sunshine wrote:\n> > On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:\n> > > These configuration variables specify the paths to commands so we should\n> > > support tilde-expansion for files inside a user's home directory.\n> > \n> > Hmm, I don't see anything in the documentation which says that these\n> > are paths to commands, and the code itself treats them purely as\n> > commands to be invoked, not as paths to commands. What is the\n> > behavior, for instance, with --tocmd='foobar -x zopp' or even\n> > --tocmd='foobar -x ~/zopp'?\n> \n> The path behaviour only expands leading '~' and '~user' (as documented\n> in git-config(1)):\n> \n> \t$ git -c sendemail.tocmd='foobar -x ~/zopp' config --path sendemail.tocmd\n> \tfoobar -x ~/zopp\n\nWe usually run user-supplied commands with a shell (and AFAICT, that is\nthe case here). So wouldn't that turn into (when used by send-email):\n\n  sh -c 'foobar -x ~/zopp'\n\nand the shell would expand it for us? Running:\n\n  git -c sendemail.tocmd='echo ~/foo' send-email -1\n\nseems to work for me (it puts \"/home/peff/foo\" into the \"to\" header).\n\n-Peff\n"},{"id":"273670","messageId":"20151124225824.GB18913@serenity.lan","threadId":"40817","inReplyTo":"20151124222330.GF29185@sigill.intra.peff.net","subject":"Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-11-24T22:58:24Z","receivedAt":"2015-11-24T22:58:24Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Tue, Nov 24, 2015 at 05:23:30PM -0500, Jeff King wrote:\n> On Tue, Nov 24, 2015 at 08:43:53AM +0000, John Keeping wrote:\n> \n> > On Mon, Nov 23, 2015 at 07:04:46PM -0500, Eric Sunshine wrote:\n> > > On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:\n> > > > These configuration variables specify the paths to commands so we should\n> > > > support tilde-expansion for files inside a user's home directory.\n> > > \n> > > Hmm, I don't see anything in the documentation which says that these\n> > > are paths to commands, and the code itself treats them purely as\n> > > commands to be invoked, not as paths to commands. What is the\n> > > behavior, for instance, with --tocmd='foobar -x zopp' or even\n> > > --tocmd='foobar -x ~/zopp'?\n> > \n> > The path behaviour only expands leading '~' and '~user' (as documented\n> > in git-config(1)):\n> > \n> > \t$ git -c sendemail.tocmd='foobar -x ~/zopp' config --path sendemail.tocmd\n> > \tfoobar -x ~/zopp\n> \n> We usually run user-supplied commands with a shell (and AFAICT, that is\n> the case here). So wouldn't that turn into (when used by send-email):\n> \n>   sh -c 'foobar -x ~/zopp'\n> \n> and the shell would expand it for us? Running:\n> \n>   git -c sendemail.tocmd='echo ~/foo' send-email -1\n> \n> seems to work for me (it puts \"/home/peff/foo\" into the \"to\" header).\n\nAh, I hadn't tested it.  We can drop this patch then.\n"}]}