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

Re: [PATCH v2 0/3] completion: bash: support for recursive/nested aliases

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 10, 2020, 02:09 UTC
Message-ID
<CAMP44s3qF2ie=+EgScyQtk_Z5qDeeWXBrJV61NTOkxOy6eBD-g@mail.gmail.com>
In-Reply-To
<xmqqv9ee7zkx.fsf@gitster.c.googlers.com>
On Mon, Nov 9, 2020 at 7:47 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> It is unclear why 3/3 needs to be separate (in other words, is there
> a reason why 1/3 and 2/3 need to be done while the function is in
> the more complex form, instead of doing what 1/3 and 2/3 wanted to
> do to the function in a way that does not require later clean-up?),
> but other than that, the end-result looks good.

It doesn't need to be separate. It's there just because the jump from the current code to 1/3 is more natural this way (v2), but 3/3 can certainly be merged to 1/3. We will have something a little bit odd in the history:

  cur=$last
  if [[ "$cur" != "$1" ]]; then
    echo "$cur"
  fi

Why not just use $last instead of $cur? And in fact why clear $cur if we are going to be setting it again?

It's just a little odd, but I sent a v3 with 1/3 and 3/3 merged, and it's not too odd.

Cheers.
-- 
Felipe Contreras
Previous: Junio C Hamano
Message 6 of 6 in “completion: bash: support for recursive/nested aliases”
  1. 0/3 completion: bash: support for recursive/nested aliasesFelipe Contreras, Nov 10, 2020
  2. 1/3 completion: bash: support recursive aliasesFelipe Contreras, Nov 10, 2020
  3. 2/3 completion: bash: check for alias loopFelipe Contreras, Nov 10, 2020
  4. 3/3 completion: bash: simplify __git_aliased_commandFelipe Contreras, Nov 10, 2020
  5. Junio C HamanoNov 10, 2020
  6. Felipe ContrerasNov 10, 2020

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.