From: Ramkumar Ramachandra Date: Fri, 03 Jan 2014 07:51:17 GMT Subject: Re: [PATCH 2/4] completion: introduce __gitcomp_2 () Message-ID: In-Reply-To: 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 both cases? Who keeps track of the index "i" of COMPREPLY (it's currently a local variable)? If we make it global, doesn't every function that deals with COMPREPLY be careful to reset it? More importantly, can you see a usecase for more than two completion classes?