From: Jeff King Date: Thu, 29 Nov 2007 14:51:39 GMT Subject: Re: [PATCH] Highlight keyboard shortcuts in git-add--interactive Message-ID: <20071129145139.GC32670@coredump.intra.peff.net> In-Reply-To: <1196337638-45972-1-git-send-email-win@wincent.com> On Thu, Nov 29, 2007 at 01:00:38PM +0100, Wincent Colaiuta wrote: > A new function is added to detect the shortest unique prefix and this > is used to decide what to highlight. Highlighting is also applied when > choosing files. I think this is very nicely implemented. Acked-by: Jeff King > +# returns an array of tuples (prefix, remainder) > +sub find_unique_prefixes { > + my @stuff = @_; I know we generally use this more C-ish argument convention to document "here are the arguments to this function", but it does actually make a copy of the @_ array (and using @_ implies a potentially large number of arguments). It probably doesn't matter here, though, since add--interactive is not performance critical, and you probably can't have more than a few dozen entries before it becomes unreadable anyway. -Peff