Re: [PATCH/RFC] completion: complete refs in multiple steps

2019-01-29 Thread SZEDER Gábor
On Tue, Jan 29, 2019 at 07:43:45AM +0700, Duy Nguyen wrote: > On Tue, Jan 29, 2019 at 12:27 AM Jeff King wrote: > > > In general I think it would be much better to rely more on 'git > > > for-each-ref' to do the heavy lifting, extending it with new format > > > specifiers/options as necessary. >

Re: [PATCH/RFC] completion: complete refs in multiple steps

2019-01-28 Thread Jeff King
On Tue, Jan 29, 2019 at 07:43:45AM +0700, Duy Nguyen wrote: > > > In general I think it would be much better to rely more on 'git > > > for-each-ref' to do the heavy lifting, extending it with new format > > > specifiers/options as necessary. > > > > FWIW, that was my first thought, too. > > I wa

Re: [PATCH/RFC] completion: complete refs in multiple steps

2019-01-28 Thread Duy Nguyen
On Tue, Jan 29, 2019 at 12:27 AM Jeff King wrote: > > On Mon, Jan 28, 2019 at 03:38:28PM +0100, SZEDER Gábor wrote: > > > > - __gitcomp_direct "$(__git_refs "$remote" "$track" "$pfx" "$cur_" > > > "$sfx")" > > > + __gitcomp_direct "$(__git_refs "$remote" "$track" "$pfx" "$cur_" > > > "$sfx"

Re: [PATCH/RFC] completion: complete refs in multiple steps

2019-01-28 Thread Jeff King
On Mon, Jan 28, 2019 at 12:27:07PM -0500, Jeff King wrote: > Doing that requires actually understanding that the refs are in a list, > and not formatting each one independently. So I kind of wonder if it > would be easier to simply have a completion mode in ref-filter. Er, I meant "a completion m

Re: [PATCH/RFC] completion: complete refs in multiple steps

2019-01-28 Thread Jeff King
On Mon, Jan 28, 2019 at 03:38:28PM +0100, SZEDER Gábor wrote: > > - __gitcomp_direct "$(__git_refs "$remote" "$track" "$pfx" "$cur_" > > "$sfx")" > > + __gitcomp_direct "$(__git_refs "$remote" "$track" "$pfx" "$cur_" "$sfx" > > | __git_collapse_refs "$cur_")" > > } > > In general I think i

Re: [PATCH/RFC] completion: complete refs in multiple steps

2019-01-28 Thread SZEDER Gábor
On Mon, Jan 28, 2019 at 04:41:55PM +0700, Nguyễn Thái Ngọc Duy wrote: > This is in the same spirit of f22f682695 (completion: complete general > config vars in two steps - 2018-05-27). Instead of considering all full > refs as completion candidates, it completes one "path" component at a > time, e.

[PATCH/RFC] completion: complete refs in multiple steps

2019-01-28 Thread Nguyễn Thái Ngọc Duy
This is in the same spirit of f22f682695 (completion: complete general config vars in two steps - 2018-05-27). Instead of considering all full refs as completion candidates, it completes one "path" component at a time, e.g. $ git switch-branch -d j jch/junio-gpg-pub $ git