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)



Bart Schaefer wrote on Sun, May 17, 2015 at 21:00:27 -0700:
> On May 17, 11:40pm, Daniel Shahaf wrote:
> } Subject: Re: [PATCH] compdescribe fix for unsorted groups (workers/34814) 
> }
> } Bart Schaefer wrote on Sat, May 16, 2015 at 21:07:35 -0700:
> } > In any case I can't reproduce your reported problem, at least not quite
> } > as you explain it above.
> } > 
> } > Starting from commit d52bf91659522435d68f719389095001f050b6c5, I applied
> } > DH's seven patches and then your 35127
> 

> Then you have this:
> 
> } 1                          4                          dot-zsh-3.1.5-pws-17       master                     zsh-4.0-patches
> } 2                          \#CVSPS.NO.BRANCH          dot-zsh-3.1.5-pws-19       zsh                        zsh-4.2-patches
> } 3                          dot-zsh-3.1.5-pws-14       interrupt_abort            zsh-3.1.5-pws-16-patches   
> 
> Something is generating 1 2 3 4 as possible completions.  Do you perhaps
> have a git alias for a command that's being invoked by _git, so that the
> output is not as _git expects?  (The "stray" 1 in your output is the 1 on
> the command line matching exactly the 1 in this listing.)

The "1 2 3 4" come from these remote branches:

% git for-each-ref | grep pr/
e1a7e686156e0e450164151dd1d3be192574bed3 commit	refs/remotes/github/pr/1
a1cf0253d8437aac4858e65b0a07c97243f15ec6 commit	refs/remotes/github/pr/2
14e5aa4b0cf69134b36dfde72c8dec19d99bf1ff commit	refs/remotes/github/pr/3
60e0f7163b9a06d8f7acd612db914ab335c65396 commit	refs/remotes/github/pr/4
% git config -l | grep remote.github
remote.github.url=https://github.com/zsh-users/zsh
remote.github.fetch=+refs/heads/*:refs/remotes/github/*
remote.github.fetch=+refs/pull/*/head:refs/remotes/github/pr/*
remote.github.skipfetchall=true

> OK, now starting from commit 34a1489f436d95bc2404f8e371130a469cbccebe, I
> apply 35127 and:
> 
> torch% zstyle -L
> zstyle ':completion:*:messages' format %S%d%s
> zstyle ':completion:*:warnings' format 'No matches for %U%d%u'
> zstyle ':completion:*' format '%SCompleting %U%d%u%s'
> zstyle ':completion:*' group-name ''
> zstyle ':completion:*' ignore-parents parent pwd ..
> zstyle ':completion::*' insert-tab 'pending=1'
> zstyle ':completion:*' menu 'yes=long' 'select=long-list'
> zstyle ':completion:*' verbose true
> torch% git checkout 1<TAB>
> Completing recent commit object name
> 1d5b225  -- 35100: __git_recent_commits: massage ' ->*' from heads (3 hours 
> 153a99d  -- 35154: NEWS on arithmetic evaluation changes (3 days ago)
> 15aa99b  -- 35139: complete the new (b) parameter flag (3 days ago)
> 1d5b225  -- 35100: __git_recent_commits: massage ' ->*' from heads (3 hours 
> 153a99d  -- 35154: NEWS on arithmetic evaluation changes (3 days ago)
> 15aa99b  -- 35139: complete the new (b) parameter flag (3 days ago)

I get the same, modulo the additional remote branch.

> Is there something else being found in your git tree(s) that I don't have?

You tried to complete 'git checkout 1<TAB>'.  The bug reproduces when
I do 'git checkout <TAB>', i.e., space-tab, not space-digitone-tab.

I can still reproduce the bug in the above setting (34a1489 plus 35127
plus either set of zstyles), even after I remove my ~/.gitconfig and cd
to a fresh clone of git://git.code.sf.net/p/zsh/code.

I haven't noticed this before, but after pressing space and tab I get
a "zsh: do you wish to see all 140 possibilities (124 lines)?" prompt
that I answer 'y' to.  The figure 140 is because there are 100
completions and 40 descriptions; that is, the descriptions are counted
towards the total number of offered completions.  Why would descriptions
be counted towards the total number of completions?

Cheers,

Daniel



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