Re: [PATCH] completion: add option completion for most builtin commands

2018-03-24 Thread Duy Nguyen
On Thu, Mar 22, 2018 at 6:56 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> +__git_main_with_parseopt_helper=' >> + blame cat-file check-attr check-ignore >> + check-mailmap checkout-index column count-objects fast-export >> + hash-object

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-22 Thread Duy Nguyen
On Thu, Mar 22, 2018 at 6:56 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> +__git_main_with_parseopt_helper=' >> + blame cat-file check-attr check-ignore >> + check-mailmap checkout-index column count-objects fast-export >> + hash-object

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-22 Thread Junio C Hamano
Duy Nguyen writes: > +__git_main_with_parseopt_helper=' > + blame cat-file check-attr check-ignore > + check-mailmap checkout-index column count-objects fast-export > + hash-object index-pack interpret-trailers merge-file mktree > + pack-objects pack-refs prune

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-22 Thread Duy Nguyen
On Thu, Mar 22, 2018 at 10:11:53AM -0700, Junio C Hamano wrote: > Duy Nguyen writes: > > >> And that pattern repeats throughout the patch. I wonder if we can > >> express the same a lot more concisely by updating the caller that > >> calls these command specific helpers? > >

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-22 Thread Junio C Hamano
Duy Nguyen writes: >> And that pattern repeats throughout the patch. I wonder if we can >> express the same a lot more concisely by updating the caller that >> calls these command specific helpers? > > Yeah. I almost went to just generate and eval these functions. But we >

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-21 Thread Duy Nguyen
On Wed, Mar 21, 2018 at 9:59 PM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> These commands can take options and use parse-options so it's quite >> easy to allow option completion. This does not pollute the command >> name completion though.

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-21 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > These commands can take options and use parse-options so it's quite > easy to allow option completion. This does not pollute the command > name completion though. "git " will show you the same set as > before. This only kicks in when you type

[PATCH] completion: add option completion for most builtin commands

2018-03-21 Thread Nguyễn Thái Ngọc Duy
These commands can take options and use parse-options so it's quite easy to allow option completion. This does not pollute the command name completion though. "git " will show you the same set as before. This only kicks in when you type the correct command name. Some other builtin commands are