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)

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.

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.
 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).

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
-- bar
-- foo
-- bar
-- foo

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