From: Felipe Contreras Date: Wed, 11 Apr 2012 22:21:17 GMT Subject: Re: [PATCH 07/12] completion: simplify command stuff Message-ID: In-Reply-To: <20120411221430.GT2289@goldbirke> 2012/4/12 SZEDER Gábor : > Hi, > > > On Sun, Apr 08, 2012 at 06:07:54AM +0300, Felipe Contreras wrote: >> No need to recalculate it. > > Based on this short description I would expect that this "command > stuff" is calculated somewhere, and a helper function is changed to > use the already calculated value ... [...] > ... but the bulk of this change is in the top-level _git() function, > as it renames a variable there to match the variable name in the > helper function.  Perhaps it should be the other way around. > > However, this change "promotes" the command (or cmd) variable from > being just a variable in _git() to a variable that is used in other > completion functions, too.  Why not go one more step further, and > denote this by adding a __git prefix (i.e. renaming the variable to > __git_command)? After thinking more about it, and analyzing the next patches, I don't think it makes sense to have such a variable; it's only used by __git_complete_remote_or_refspec, and it would be easier to make it an argument to that function; that would simplify this patch series a lot. Cheers. -- Felipe Contreras