From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14357 invoked by alias); 3 Nov 2015 13:42:49 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37052 Received: (qmail 1001 invoked from network); 3 Nov 2015 13:42:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=GLDDU67YXZk5d2kQ pSdkfPPWSmo=; b=Qvx/xdKGq2alJpq0bpbCxjo/NzZ55XRYCq8NmbQWZefb0DEi UFHfdSOLATmLCGy2ttrZd85ASbqS4kurW2ySb9H6vd1blYg63KUmlPzFFDlfzz6D GXJPY5XD8eAeKjek4jxXiwP7bnvoi6yfi7aUpHroqpV8o96ce3E3X5eh3m8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=GLDDU67YXZk5d2k QpSdkfPPWSmo=; b=nqAZnqokTHlk0tjcKd50Df1OAZDmZDWWDmHvvfE9XGOnJll nP2Hg30hAT8dRe6ceagqUssY+ztcfU9GnraksTi7Uxt8CEyYuC9pdhDkOlxzrZeS nXQrm/F3G7mYreKW+iOklM1fxpVbDzoVAz08PSJ3w50oxYjLRTsbZo+DuJzI= X-Sasl-enc: C9rkrQUYRcY9LtPwi62R6p3IWVg/crWsDxxawtUelDE9 1446558160 Date: Tue, 3 Nov 2015 13:42:34 +0000 From: Daniel Shahaf To: Oliver Kiddle 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. Message-ID: <20151103134234.GA3018@tarsus.local2> References: <20151025183458.GK11372@tarsus.local2> <20151031125127.GA2360@tarsus.local2> <25552.1446323081@thecus.kiddle.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <25552.1446323081@thecus.kiddle.eu> User-Agent: Mutt/1.5.21 (2010-09-15) 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=', but not in 'git > > show '. 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.