git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.keller@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Keller, Jacob E" <jacob.e.keller@intel.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	"gitster@pobox.com" <gitster@pobox.com>,
	"spearce@spearce.org" <spearce@spearce.org>,
	"lee.marlow@gmail.com" <lee.marlow@gmail.com>,
	"felipe.contreras@gmail.com" <felipe.contreras@gmail.com>,
	"szeder@ira.uka.de" <szeder@ira.uka.de>
Subject: Re: [PATCH v2 1/2] sendemail: teach git-send-email to list aliases
Date: Tue, 17 Nov 2015 00:25:23 -0800	[thread overview]
Message-ID: <CA+P7+xo_ecs6iVK2byF1E7disNvKiKbacBUk4r2eSNWQtR+X-Q@mail.gmail.com> (raw)
In-Reply-To: <20151117072049.GA25414@flurp.local>

On Mon, Nov 16, 2015 at 11:20 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> Since git-send-email.perl already configures GetOpt::Long with the
> 'pass_through' option, one possibility would be to invoke
> GetOptions() once for --list-aliases (or --dump-aliases), and then
> again for the normal options. Doing so may be a bit ugly; on the
> other hand, it does indicate pretty clearly that --list-aliases is a
> distinct "mode" of operation. On top of your patch, it might look
> something like this:
>
> --- 8< ---
> diff --git a/git-send-email.perl b/git-send-email.perl
> index ee14894..cada5ea 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -296,6 +296,12 @@ $SIG{INT}  = \&signal_handler;
>
>  my $help;
>  my $rc = GetOptions("h" => \$help,
> +                   "list-aliases" => \$list_aliases);
> +usage() unless $rc;
> +die "--list-aliases incompatible with other options\n"
> +       if !$help and $list_aliases and @ARGV;
> +
> +$rc = GetOptions(
>                     "sender|from=s" => \$sender,
>                      "in-reply-to=s" => \$initial_reply_to,
>                     "subject=s" => \$initial_subject,
> @@ -349,7 +355,6 @@ my $rc = GetOptions("h" => \$help,
>                     "force" => \$force,
>                     "xmailer!" => \$use_xmailer,
>                     "no-xmailer" => sub {$use_xmailer = 0},
> -                    "list-aliases" => \$list_aliases,
>          );
>
>  usage() if $help;
> --- 8< ---
>
> Though, it may be overkill for this minor use-case.

I actually really like this approach. I will squash it in.

Regards,
Jake

  reply	other threads:[~2015-11-17  8:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-15 20:22 [PATCH v2 1/2] sendemail: teach git-send-email to list aliases Jacob Keller
2015-11-15 20:22 ` [PATCH v2 2/2] completion: add support for completing email aliases Jacob Keller
2015-11-16 23:33   ` Eric Sunshine
2015-11-16 23:40     ` Keller, Jacob E
2015-11-16 23:30 ` [PATCH v2 1/2] sendemail: teach git-send-email to list aliases Eric Sunshine
2015-11-16 23:40   ` Keller, Jacob E
2015-11-16 23:50     ` Eric Sunshine
2015-11-16 23:56       ` Eric Sunshine
2015-11-17  0:09         ` Keller, Jacob E
2015-11-17  0:10       ` Keller, Jacob E
2015-11-17  7:20         ` Eric Sunshine
2015-11-17  8:25           ` Jacob Keller [this message]
2015-11-17 12:26           ` SZEDER Gábor
2015-11-17 16:27             ` Jacob Keller

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=CA+P7+xo_ecs6iVK2byF1E7disNvKiKbacBUk4r2eSNWQtR+X-Q@mail.gmail.com \
    --to=jacob.keller@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.e.keller@intel.com \
    --cc=lee.marlow@gmail.com \
    --cc=spearce@spearce.org \
    --cc=sunshine@sunshineco.com \
    --cc=szeder@ira.uka.de \
    /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 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 NNTP newsgroup(s).