From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Pascal Obry <pascal@obry.net>, git@vger.kernel.org
Subject: Re: [PATCH v3 3/3] New send-email option smtpserveroption.
Date: Mon, 6 Sep 2010 12:23:57 +0200 [thread overview]
Message-ID: <201009061223.59090.jnareb@gmail.com> (raw)
In-Reply-To: <7vpqwrv0l2.fsf@alter.siamese.dyndns.org>
On Mon, 6 Sep 2010, Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>> Pascal Obry <pascal@obry.net> writes:
>>> ---
>>> Documentation/git-send-email.txt | 8 ++++++++
>>> git-send-email.perl | 8 +++++++-
>>> 2 files changed, 15 insertions(+), 1 deletions(-)
>>
>> Needs update to Documentation/config.txt, adding line about
>> sendemail.smtpserveroption.
>
> And test if it is easy to arrange (otherwise I'll take a look myself, so
> do not worry too much about it).
Actually because *all* options use the same mechanism (%config_settings
which is used in read_config, and GetOptions from Getopt::Long), it would
be better to just test the mechanism, I think.
But that is outside the scope of this patch... and probably require
moving (some of) functionality to Git.pm
>>> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
>>> index c283084..5af05bc 100644
>>> --- a/Documentation/git-send-email.txt
>>> +++ b/Documentation/git-send-email.txt
>>> @@ -157,6 +157,14 @@ user is prompted for a password while the input is masked for privacy.
>>> `/usr/lib/sendmail` if such program is available, or
>>> `localhost` otherwise.
>>>
>>> +--smtp-server-option=<option>::
>>> + If set, specifies the outgoing SMTP server option to use.
>>> + Default value can be specified by the 'sendemail.smtpserveroption'
>>> + configuration option.
>>> ++
>>> +The --smtp-server-option option must be repeated for each option you want
>>> +to pass to the server.
>>
>> Just a nitpick.
>>
>> How do multiple options are supported with sendemail.smtpserveroption?
>> This also needs to be described, I think.
>
> That is a good and important point.
>
> We could
>
> [sendemail]
> smtpserveroption = opt1
> smtpserveroption = opt2
>
We do it this way, the same as for 'sendemail.to'... though I admit
that it is much more natural for 'sendemail.to' than for
'sendemail.smtpServerOption'.
> or if we choose to split at WS
>
> [sendemail]
> smtpserveroption = "opt1 opt2"
>
> but with the second form there always is this nagging "how would you
> specify an option with WS in it" issue, so the former might be easier.
Yes, there would be a problem with something like this:
[sendemail]
smtpserveroption = "opt1 'opt2_a opt2_b'"
We could use extract_delimited or extract_quotelike, or just a regexp
generated using gen_delimited_pat from Text::Balanced. Or better use
shellwords from Text::ParseWords
Text::ParseWords is in Perl core since Perl 5... which is I think good
enough for Git.
If we go this route we should probably provide shellwords / shellsplit /
/ split_sq also for C.
>
>
> If we take the latter route, we should take a single command line option
> and split it, i.e. --smtp-server-option='opt1 opt2', using the same WS
> quoting mechanism, for consistency between command line and configuration.
Right.
> I dunno. Have we solved a similar issue with other parts of the system,
> and how?
>
>>> @@ -1015,6 +1019,8 @@ X-Mailer: git-send-email $gitversion
>>> }
>>> }
>>>
>>> + unshift (@sendmail_parameters, @smtp_server_options);
>>> +
>>
>> I guess that you are following strange style that other 'unshift'
>> invocation uses, but there should be no space between function and
>> opening parentheses beginning its arguments, e.g.
>>
>> join("\n", @xh)
>>
>> not
>>
>> join ("\n", @xh)
>
> I tend to prefer shift/unshift/push/pop written without these
> parentheses. Is it just me?
The Perl-ish way is to avoid parentheses for built-in functions with
prototypes, such as shift/unshift/join. But consistency trumps this
rule, I think (till the cleanup :-))
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2010-09-06 10:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-05 17:48 [PATCH v3 0/3] Add support for SMTP server options Pascal Obry
2010-09-05 17:48 ` [PATCH v3 1/3] Minor indentation fix Pascal Obry
2010-09-05 17:48 ` [PATCH v3 2/3] Remove @smtp_host_parts variable as not used Pascal Obry
2010-09-05 17:49 ` [PATCH v3 3/3] New send-email option smtpserveroption Pascal Obry
2010-09-05 21:49 ` Jakub Narebski
2010-09-06 6:38 ` Junio C Hamano
2010-09-06 9:27 ` Ævar Arnfjörð Bjarmason
2010-09-06 10:23 ` Jakub Narebski [this message]
2010-09-06 21:13 ` Junio C Hamano
2010-09-05 20:34 ` [PATCH v3 0/3] Add support for SMTP server options Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201009061223.59090.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pascal@obry.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.