Re: [PATCH 02/12] completion: simplify __gitcomp
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Apr 8, 2012, 13:07 UTC
- Message-ID
- <CAMP44s0nSH7ZjC4T=7pXS2MyAkZ133hOXa_tn3q4er+FbcOc_w@mail.gmail.com>
- In-Reply-To
- <20120408124652.GN2289@goldbirke>
2012/4/8 SZEDER Gábor <szeder@ira.uka.de>:
Show 11 quoted lines
> On Sun, Apr 08, 2012 at 06:07:49AM +0300, Felipe Contreras wrote: >> The suffix is never used. > > The suffix was used to offer completion after 'git config > branch.<TAB>' ending with a period. It is not used by git's > completion script anymore, because nowadays this case is handled by > the __gitcomp_nl helper() function. > > However, users can provide custom completion functions to their > aliases or additional git commands, and there might be a custom > completion function out there that passes a suffix to __gitcomp().
Yes, there _might_ be, and they would have to be fixed; APIs change. However, this is highly theoretical, what suffix could anybody possibly want? I believe __gitcomp_1 already does the job of adding sensible suffixes, and there's nothing else anybody else could possibly want.
In any case, shouldn't compgen -S "${4-}" do the trick?> We don't want to break those custom completion functions, so I think > the suffix should stay.
So we should never make any cleanups because some custom completion functions might theoretically break? I think at some point we need to accept that nobody is using this argument anyway (and they should).
Cheers.
-- Felipe Contreras