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

Re: [PATCH 3/3] send-email: teach git send-email option to translate aliases

From
Jacob Keller <jacob.e.keller@intel.com>
Date
Aug 9, 2024, 19:51 UTC
Message-ID
<5ad39a07-a2d4-45d2-9b5d-0180cb903801@intel.com>
In-Reply-To
<xmqq7ccpcx9e.fsf@gitster.g>
On 8/9/2024 12:27 PM, Junio C Hamano wrote:
Show 9 quoted lines
> 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?

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 10 in “send-email: teach git send-email mode to translate aliases”
  1. 0/3 send-email: teach git send-email mode to translate aliasesJacob Keller, Aug 8, 2024
  2. 1/3 t90001-send-email.sh: fix quoting for mailrc --dump-aliases testJacob Keller, Aug 8, 2024
  3. 2/3 t9001-send-email.sh: update alias list used for pine testJacob Keller, Aug 8, 2024
  4. 3/3 send-email: teach git send-email option to translate aliasesJacob Keller, Aug 8, 2024
  5. Junio C HamanoAug 8, 2024
  6. Jacob KellerAug 9, 2024
  7. Junio C HamanoAug 9, 2024
  8. Jacob KellerAug 9, 2024
  9. Junio C HamanoAug 9, 2024
  10. Jacob KellerAug 10, 2024

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.