Re: [QUERY] How do you sort completions?

2013-05-28 Thread SZEDER Gábor
Hi, On Fri, May 24, 2013 at 08:11:00AM -0500, Felipe Contreras wrote: > AFAIK bash needs the completions sorted, so we added some | sort | > uniq. Actually, it seems to sort and remove duplicates automatically: $ _foo () { COMPREPLY=("bar" "foo" "bar" "baz") ; } $ complete -F _foo foo $ foo bar

RE: [QUERY] How do you sort completions?

2013-05-24 Thread Marc Khouzam
> -Original Message- > From: git-ow...@vger.kernel.org > [mailto:git-ow...@vger.kernel.org] On Behalf Of Ramkumar Ramachandra > Sent: Friday, May 24, 2013 12:19 PM > To: SZEDER Gábor > Cc: Git List; Felipe Contreras > Subject: Re: [QUERY] How do you sort completio

Re: [QUERY] How do you sort completions?

2013-05-24 Thread Ramkumar Ramachandra
Antoine Pelisse wrote: > I think sorting is required for faster look-up, most likely with > dichotomic search. Otherwise it would have to search the whole list > each time. Oh, it's probably keeping just one copy of the completions in memory (which has to be sorted for search); this is also used t

Re: [QUERY] How do you sort completions?

2013-05-24 Thread Antoine Pelisse
On Fri, May 24, 2013 at 6:18 PM, Ramkumar Ramachandra wrote: > Damn; so it's impossible to have a custom-sorted completion list in > bash. Any idea about zsh? I know that there are completion groups, > but I'd really like custom sorting. I think sorting is required for faster look-up, most like

Re: [QUERY] How do you sort completions?

2013-05-24 Thread Ramkumar Ramachandra
SZEDER Gábor wrote: > I don't know who does the sorting (Bash or readline), and I don't know > any way to disable it. Damn; so it's impossible to have a custom-sorted completion list in bash. Any idea about zsh? I know that there are completion groups, but I'd really like custom sorting. -- To u

Re: [QUERY] How do you sort completions?

2013-05-24 Thread SZEDER Gábor
Hi, On Fri, May 24, 2013 at 05:03:27PM +0530, Ramkumar Ramachandra wrote: > I'm not able to sort completions for some weird reason. No matter > what I order I insert stuff into COMPREPLY, bash seems to auto-sort > them lexically. I tried to pass --sort='-committerdate' to git > for-each-ref so

Re: [QUERY] How do you sort completions?

2013-05-24 Thread Felipe Contreras
On Fri, May 24, 2013 at 6:33 AM, Ramkumar Ramachandra wrote: > Hi, > > I'm not able to sort completions for some weird reason. No matter > what I order I insert stuff into COMPREPLY, bash seems to auto-sort > them lexically. I tried to pass --sort='-committerdate' to git > for-each-ref so I can

[QUERY] How do you sort completions?

2013-05-24 Thread Ramkumar Ramachandra
Hi, I'm not able to sort completions for some weird reason. No matter what I order I insert stuff into COMPREPLY, bash seems to auto-sort them lexically. I tried to pass --sort='-committerdate' to git for-each-ref so I can get a sensible 'git checkout ' reply, and I'm very annoyed that it doesn'