git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 12:51:45 -0700	[thread overview]
Message-ID: <5ad39a07-a2d4-45d2-9b5d-0180cb903801@intel.com> (raw)
In-Reply-To: <xmqq7ccpcx9e.fsf@gitster.g>



On 8/9/2024 12:27 PM, Junio C Hamano wrote:
> Jacob Keller <jacob.e.keller@intel.com> writes:
> 
>> Dump aliases handled this by checking @ARGV and immediately bailing if
>> there were anything remaining after the call to parsing its inner
>> options. This works but does not work for --translate-aliases because it
>> needs to treat all the remaining arguments as aliases.
> 
> When GetOptions returns, shouldn't these "remaining arguments" be
> visible in @ARGV and you can iterate over them yourself, perhaps?

Yes, that is essentially what we do by skipping the call to the
GetOptions for the main set of send-email options :)

We still need to go farther down the program in order to call the
functions which parse the alias file and setup the alias map.

I guess we could re-arrange the code so that the alias bits are handled
before the options?

We also probably want to reject other option-like arguments which
ideally we would have GetOpt::Long handle for us... I think if we
disable pass_through initially in the identity/information options and
then re-enable it when we call the second GetOptions that might work?
That could get tricky...

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...

Or we could completely change the overall behavior to do something else
like take the aliases on standard input instead of the arguments?

  reply	other threads:[~2024-08-09 19:51 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 [this message]
2024-08-09 21:05           ` Junio C Hamano
2024-08-10  0:29             ` 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=5ad39a07-a2d4-45d2-9b5d-0180cb903801@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).