Re: [PATCH 2/4] completion: introduce __gitcomp_2 ()

2014-01-03 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > I am not sure what you are worried about $pfx; what does it do when > you have strings with different prefix in COMPREPLY? If it breaks, > then the answer is "don't do it then". > > Doesn't an array know its own length and give you a way to ask? Right. I was just throwing c

Re: [PATCH 2/4] completion: introduce __gitcomp_2 ()

2014-01-03 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Junio C Hamano wrote: >> __gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "." >> __gitcomp_nl_append $"autosetupmerge\nautosetuprebase\n" "$pfx" >> "$cur_" " " > > This is not a bad idea at all. I'm just afraid that we might be > leaving open ends: What

Re: [PATCH 2/4] completion: introduce __gitcomp_2 ()

2014-01-02 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > __gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "." > __gitcomp_nl_append $"autosetupmerge\nautosetuprebase\n" "$pfx" > "$cur_" " " This is not a bad idea at all. I'm just afraid that we might be leaving open ends: What happens if the $pfx isn't the same in bo

Re: [PATCH 2/4] completion: introduce __gitcomp_2 ()

2014-01-02 Thread Junio C Hamano
Ramkumar Ramachandra writes: > There are situations where two classes of completions possible. For > example > > branch. > > should try to complete > > branch.master. > branch.autosetupmerge > branch.autosetuprebase > > The first candidate has the suffix ".", and the second/ third candida

[PATCH 2/4] completion: introduce __gitcomp_2 ()

2013-12-30 Thread Ramkumar Ramachandra
There are situations where two classes of completions possible. For example branch. should try to complete branch.master. branch.autosetupmerge branch.autosetuprebase The first candidate has the suffix ".", and the second/ third candidates have the suffix " ". To facilitate completions