Re: [PATCH v7 07/13] completion: implement and use --list-cmds=main,others
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 11, 2018, 16:33 UTC
- Message-ID
- <CACsJy8Dxaizn7O1cVVXA9Gzywj7nQ5K0YMzgMkB3BQbV=W6Npg@mail.gmail.com>
- In-Reply-To
- <CAM0VKjk3kqKpVz0ZjX58REwP8rz08kLsiVR4NWDO6-9iPGPe9g@mail.gmail.com>
On Fri, May 11, 2018 at 4:06 PM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 6 quoted lines
> On Thu, May 10, 2018 at 10:46 AM, Nguyễn Thái Ngọc Duy > <pclouds@gmail.com> 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. [1] is a reported one. And since you're parsing what's meant for human reader, this code could easily break in the future.
[1] https://public-inbox.org/git/CAPQz56bts8zFfUHyKJqnefQoH97L5TTA-k3be=5HsdeEbcMqOA@mail.gmail.com/
> Is it slow? Well, there is a pipe and an egrep, sure, but thanks to > caching it's only run once, so basically doesn't matter.
This I agree is an exaggeration. Ultimately though I am breaking down and providing the information pieces to __git_list_porcelain_commands() and it happens to benefit this one too. Perhaps I should rephrase my commit to say this.
-- Duy