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

Re: [PATCH 2/4] completion: introduce __gitcomp_2 ()

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jan 3, 2014, 07:51 UTC
Message-ID
<CALkWK0mgqJFz1Lf_UVX8fdvnT+u+rp705dak7kXVFFBSr2bTQA@mail.gmail.com>
In-Reply-To
<xmqqeh4qndxs.fsf@gitster.dls.corp.google.com>
Junio C Hamano wrote:
>         __gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "."
>         __gitcomp_nl_append $"autosetupmerge\nautosetuprebase\n" "$pfx" "$cur_" " "

This is not a bad idea at all. I'm just afraid that we might be leaving open ends: What happens if the $pfx isn't the same in both cases? Who keeps track of the index "i" of COMPREPLY (it's currently a local variable)? If we make it global, doesn't every function that deals with COMPREPLY be careful to reset it?

More importantly, can you see a usecase for more than two completion classes?
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 14 in “Fix branch.autosetup(merge|rebase) completion”
  1. 0/4 Fix branch.autosetup(merge|rebase) completionRamkumar Ramachandra, Dec 30, 2013
  2. 1/4 completion: prioritize ./git-completion.bashRamkumar Ramachandra, Dec 30, 2013
  3. 2/4 completion: introduce __gitcomp_2 ()Ramkumar Ramachandra, Dec 30, 2013
  4. Junio C HamanoJan 2, 2014
  5. Ramkumar RamachandraJan 3, 2014
  6. Junio C HamanoJan 3, 2014
  7. Ramkumar RamachandraJan 3, 2014
  8. 3/4 completion: fix branch.autosetup(merge|rebase)Ramkumar Ramachandra, Dec 30, 2013
  9. Junio C HamanoJan 2, 2014
  10. Ramkumar RamachandraJan 3, 2014
  11. Junio C HamanoJan 3, 2014
  12. Ramkumar RamachandraJan 3, 2014
  13. Junio C HamanoJan 3, 2014
  14. 4/4 completion: fix remote.pushdefaultRamkumar Ramachandra, Dec 30, 2013

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.