From: Jacob Keller <jacob.e.keller@intel.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: <git@vger.kernel.org>, Jacob Keller <jacob.keller@gmail.com>,
"Konstantin Ryabitsev" <konstantin@linuxfoundation.org>
Subject: Re: [PATCH 3/3] send-email: teach git send-email option to translate aliases
Date: Fri, 9 Aug 2024 17:29:22 -0700 [thread overview]
Message-ID: <7f6d556c-c1fe-4a6f-be6f-106f2e0bca48@intel.com> (raw)
In-Reply-To: <xmqqplqhbe4o.fsf@gitster.g>
On 8/9/2024 2:05 PM, Junio C Hamano wrote:
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
>> We could try to implement scanning for options ourselves, but I wouldn't
>> want to break things like "--" to make it treat potential option-looking
>> fields as aliases...
>
> The appoach --dump-aliases takes is already broken with respect to
> options that take or do not take an argument, if you really want to
> scan, understand, and skip irrelevant options anyway, no? The
> separate, trimmed down %dump_aliases_options map cannot help you to
> tell from the command line "git cmd --translate --foo bar" if
> skipping just "--foo" gives you the alias-to-be-expanded "bar", or
> "--foo" takes an argument that is "bar" and there is no alias left.
>
The approach --dump-aliases takes is that *any* other command line
argument besides --dump-aliases will cause git send-email to exit with
an error. They are not interpreted.
The approach I had --translate-aliases take is that all other command
line arguments are treated as aliases, regardless of whether they are
possibly options, and no other options are parsed at all.
It is intended that --dump-aliases, --translate-aliases, and the regular
mode of operation are mutually exclusive.
I am leaning towards possibly making --translate-aliases take the
aliases to translate on stdin instead of using arguments at all. This
would make it function more like --dump-aliases w.r.t. command line
arguments. This is probably a lot simpler. I think I will implement it
this way for v2.
Alternatively, we could extract the logic for handling the aliases into
a separate script with its own git command, but I think it currently
relies heavily on some perl code that would be hard to translate to C.
prev parent reply other threads:[~2024-08-10 0:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 21:09 [PATCH 0/3] send-email: teach git send-email mode to translate aliases Jacob Keller
2024-08-08 21:09 ` [PATCH 1/3] t90001-send-email.sh: fix quoting for mailrc --dump-aliases test Jacob Keller
2024-08-08 21:09 ` [PATCH 2/3] t9001-send-email.sh: update alias list used for pine test Jacob Keller
2024-08-08 21:10 ` [PATCH 3/3] send-email: teach git send-email option to translate aliases Jacob Keller
2024-08-08 21:57 ` Junio C Hamano
2024-08-09 19:12 ` Jacob Keller
2024-08-09 19:27 ` Junio C Hamano
2024-08-09 19:51 ` Jacob Keller
2024-08-09 21:05 ` Junio C Hamano
2024-08-10 0:29 ` Jacob Keller [this message]
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=7f6d556c-c1fe-4a6f-be6f-106f2e0bca48@intel.com \
--to=jacob.e.keller@intel.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.keller@gmail.com \
--cc=konstantin@linuxfoundation.org \
/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).