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

Re: [PATCH] completion: fix completing unstuck email alias arguments

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Dec 13, 2015, 01:00 UTC
Message-ID
<20151213020038.Horde.rlO28-SYLxFX00yK-iahGJs@webmail.informatik.kit.edu>
In-Reply-To
<CA+P7+xrHhWHp8WA8EF7jzsit50uW13=-NEzf0DwNfMyu2dckhA@mail.gmail.com>
Quoting Jacob Keller <jacob.keller@gmail.com>:
Show 11 quoted lines
> On Fri, Dec 11, 2015 at 4:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:
>> Completing unstuck form of email aliases doesn't quite work:
>>
>> $ git send-email --to <TAB>
>> alice   bob     cecil
>> $ git send-email --to a<TAB>
>> alice   bob     cecil
>>
>
> Woops. Is it possible to add a test for this case? I honestly don't
> know how the tests for the completion works.
It's possible, but I'm not sure we should.

It's a common pattern throughout the completion script to call __gitcomp() (or __gitcomp_nl()) this way, out of the almost 200 callsites many look like this one. We don't test all those, because it would require a lot of tests for not that much gain in coverage in my opinion. The interesting thing that's definitely worth testing is what happens inside the command substitution that supplies the possible completion words, but your tests added to the send-email testsuite already cover that thoroughly.

Gábor
Previous: Jacob Keller
Message 3 of 3 in “completion: fix completing unstuck email alias arguments”
  1. completion: fix completing unstuck email alias argumentsSZEDER Gábor, Dec 12, 2015
  2. Jacob KellerDec 12, 2015
  3. SZEDER GáborDec 13, 2015

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.