[PATCH v7 07/13] completion: implement and use --list-cmds=main,others

2018-05-10 Thread Nguyễn Thái Ngọc Duy
Instead of parsing "git help -a" output, which is tricky to get right, less elegant and also slow, make git provide the list in a machine-friendly form. This adds two separate listing types, main and others, instead of just "all" for more flexibility. Signed-off-by: Nguyễn Thái Ngọc Duy --- cont

Re: [PATCH v7 07/13] completion: implement and use --list-cmds=main,others

2018-05-11 Thread SZEDER Gábor
On Thu, May 10, 2018 at 10:46 AM, Nguyễn Thái Ngọc Duy wrote: > Instead of parsing "git help -a" output, which is tricky to get right, > less elegant and also slow, Is it tricky? It seems rather straightforward. Is it slow? Well, there is a pipe and an egrep, sure, but thanks to caching it's on

Re: [PATCH v7 07/13] completion: implement and use --list-cmds=main,others

2018-05-11 Thread SZEDER Gábor
On Fri, May 11, 2018 at 4:06 PM, SZEDER Gábor wrote: > OTOH you don't mention the most important reason, namely that the > completion script contains a long hard-coded list of the names of all > known plumbing commands to filter out, which is redundant with the > categorization in 'command-list.tx

Re: [PATCH v7 07/13] completion: implement and use --list-cmds=main,others

2018-05-11 Thread Duy Nguyen
On Fri, May 11, 2018 at 4:06 PM, SZEDER Gábor wrote: > On Thu, May 10, 2018 at 10:46 AM, Nguyễn Thái Ngọc Duy > wrote: >> Instead of parsing "git help -a" output, which is tricky to get right, >> less elegant and also slow, > > Is it tricky? It seems rather straightforward. But there are traps.