zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-workers@zsh.org
Subject: Re: __git_recent_commits cannot be called twice Re: [PATCH 2/5] _git: Offer @~$n as completion of recent commits.
Date: Tue, 3 Nov 2015 13:42:34 +0000	[thread overview]
Message-ID: <20151103134234.GA3018@tarsus.local2> (raw)
In-Reply-To: <25552.1446323081@thecus.kiddle.eu>

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.


  reply	other threads:[~2015-11-03 13:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-25 18:34 Daniel Shahaf
2015-10-31 12:55 ` __git_recent_commits cannot be called twice " Daniel Shahaf
2015-10-31 20:24   ` Oliver Kiddle
2015-11-03 13:42     ` Daniel Shahaf [this message]
2015-11-13 19:11     ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151103134234.GA3018@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).