git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/2] sendemail: teach git-send-email to list aliases

From
Jacob Keller <jacob.keller@gmail.com>
Date
Nov 17, 2015, 08:25 UTC
Message-ID
<CA+P7+xo_ecs6iVK2byF1E7disNvKiKbacBUk4r2eSNWQtR+X-Q@mail.gmail.com>
In-Reply-To
<20151117072049.GA25414@flurp.local>
On Mon, Nov 16, 2015 at 11:20 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 37 quoted lines
> 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

Previous: Eric SunshineNext: SZEDER Gábor
Message 12 of 14 in “sendemail: teach git-send-email to list aliases”
  1. 1/2 sendemail: teach git-send-email to list aliasesJacob Keller, Nov 15, 2015
  2. 2/2 completion: add support for completing email aliasesJacob Keller, Nov 15, 2015
  3. Eric SunshineNov 16, 2015
  4. Keller, Jacob ENov 16, 2015
  5. Eric SunshineNov 16, 2015
  6. Keller, Jacob ENov 16, 2015
  7. Eric SunshineNov 16, 2015
  8. Eric SunshineNov 16, 2015
  9. Keller, Jacob ENov 17, 2015
  10. Keller, Jacob ENov 17, 2015
  11. Eric SunshineNov 17, 2015
  12. Jacob KellerNov 17, 2015
  13. SZEDER GáborNov 17, 2015
  14. Jacob KellerNov 17, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.