Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] compdescribe fix for unsorted groups (workers/34814) (was: Re: completion: git: --fixup: problem with _describe -2V and duplicate commit subjects)
- X-seq: zsh-workers 35227
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] compdescribe fix for unsorted groups (workers/34814) (was: Re: completion: git: --fixup: problem with _describe -2V and duplicate commit subjects)
- Date: Tue, 19 May 2015 21:01:58 +0000
- Cc: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=lYpt5dd054zX1zk+e0CojCX1CGo=; b=JXoWbg pdL5yk2KJmCXmheTl7hElHwyEuOs2CHuIj1ZP+YrChat+UioVytQgY0oRO4xzGvs 8YwHitekjplmbJrz6iwgpqs4Vmv34PvzyTLKXW1Dfmx4iipuzgyMYEswwxtP8RyO G/Y/kAMlF8J2KnFceBpMaM2paXcWzvMqg0LZc=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=lYpt5dd054zX1zk+e0CojCX1CGo=; b=edQKo ibjM0pkAedyNjKAAvVwlaEL/qjnHnG4BDNGLfS7XFY7lhuSc9hNd9Q+XfK9iFHNU WpuogghcpHnk+Hbp/GUvl3iH3micIKr6XmPqBOfm35t7NBz/CssV8b/iqWJPamzF 0ezMC+xqbmrPs6/8OXLKJIP1LAOIlBeKwobYEA=
- In-reply-to: <20150519204446.GC1837@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <5510AAD4.8040807@thequod.de> <20150329054753.GA2766@tarsus.local2> <20150514143627.GE1932@tarsus.local2> <20150519204446.GC1837@tarsus.local2>
Daniel Shahaf wrote on Tue, May 19, 2015 at 20:44:46 +0000:
> Daniel Shahaf wrote on Thu, May 14, 2015 at 14:36:27 +0000:
> > The first attached patch seems to address this. However,
> > I encountered an odd problem with it, which I have not been able to
> > narrow down. [... 'git checkout 1<TAB>' ...] I'm not sure whether
> > this indicates a bug in the first patch or an independent problem.
>
> The 'git checkout <TAB>' issue is an independent problem.
>
> Daniel Hahler has determined that the garbled output is due to _git's
> calling __git_commit_objects twice (cf 35216). The attached minimal
> example demonstrates the problem.
>
> So, in summary:
>
> 1. The first patch in 35127 fixes the problem introduced by 34671,
> reported in 34768, and analysed in 34814. The minimal example at the
> top of 35127 produces garbled output without 35127 and correct output
> with 35127.
>
> 2. The second patch in 35127 triggered garbled output in 'git checkout
> <TAB>' because of a preexisting problem in _git, which 35216 fixes.
> An example of the garbled output is in 35169, surrounded by triple
> square brackets.
>
With both 35127 and 35169 applied, I get the :descriptions message
twice:
> recent commit object name
> recent commit object name
cf83173 HEAD - debug (12 minutes ago)
...
The duplicate goes away if I revert
ed3e5f521d1243981831d7e084225b03e205ae38 (35209), i.e., add back the -2.
I verified that __git_recent_commits is called only once, so 35169 is
not at fault here. I'm not sure what the actual problem is: whether
35209 should be reverted (the -2 added back), or 35127#1 should be
smarter about how compdescribe calls compadd (cf empty matches discussed
in 34814). I'll investigate later.
Cheers,
Daniel
> 3. I propose the following documentation patch:
>
> diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
> index a081ea3..5043e7b 100644
> --- a/Doc/Zsh/compsys.yo
> +++ b/Doc/Zsh/compsys.yo
> @@ -4197,6 +4197,9 @@ description will appear together in the list.
>
> tt(_describe) uses the tt(_all_labels) function to generate the matches, so
> it does not need to appear inside a loop over tag labels.
> +
> +tt(_describe) should not be called more than once in a single call to
> +a completion function.
> )
> findex(_description)
> item(tt(_description) [ tt(-x) ] [ tt(-12VJ) ] var(tag) var(name) var(descr) [ var(spec) ... ])(
>
> Unless objections, I'll commit 35127#1 (the first of the two patches
> attached to that email).
>
> Daniel
> a=(dalton:bar charlie:bar bob:foo alice:foo)
> _ftwice() { _describe -2 -V -x person a; _describe -2 -V -x person a }; compdef _ftwice ftwice
> % ftwice <TAB>
> > person
> charlie
> alice
> dalton
> bob
> -- bar
> -- foo
> charlie
> alice
> dalton
> bob
> -- bar
> -- foo
Messages sorted by:
Reverse Date,
Date,
Thread,
Author