Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: __git_recent_commits cannot be called twice Re: [PATCH 2/5] _git: Offer @~$n as completion of recent commits.



Oliver Kiddle wrote on Sat, Oct 31, 2015 at 21:24:41 +0100:
> Daniel Shahaf wrote:
> 
> > The new output works fine in 'git commit --fixup=<TAB>', but not in 'git
> > show <TAB>'.  This is because the latter calls __git_recent_commits via
> > two distinct codepaths.  Here's a minimal example:
> 
> Calling one function via two codepaths is the basic problem here. We
> should avoid doing that rather than trying to hack it to work.
> 

'git show ARG' can be either a tree or a revision.  The latter calls
into __git_recent_commits directly; the former calls it because one form
to specify a tree is ${committish}:${subpath} (as in 'git show
HEAD^:Etc/').  That's why two codepaths reach the same function... it's
not a mistake, it's simply reflecting git's syntax.

> I've been thinking that it could be useful to add a helper like
> _describe but lacking the feature of grouping matches with a common
> description. That's the key feature of _describe. _describe is often
> used when it perhaps shouldn't be because it is also a simple and
> convenient function when you want descriptions. Any ideas on a name for
> such a new helper?

"_annotate".

Thanks for the rest of the email — a bit busy now but will reply when
I can.



Messages sorted by: Reverse Date, Date, Thread, Author