Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

tag-order with git refs



Things that have been bugging me for ages but I never dared ask
about...

Notionally this is a user question, though I suspect it's soon going to
drift down the implementation.

How do I limit completion after "git checkout" to showing local heads
first (i.e. branches I actually use)?

If you can demonstrably get this to work (please don't waste time
posting untried solutions), feel free to give tne answer and ignore the
following.

From the output of ^xh it should be something like

zstyle ':completion:*:complete:git-checkout:*' tag-order heads-local

and certainly the look-up of the style and context appears to be
working.  But the match against the actual tag doesn't work (proved by
adding "-" to the end, which gives me no matches at all).

The manual implies patterns should work as tags (i.e. values of the
tag-order style) but I'm getting bizarre results --- e,g '[a-z]*' gives
me everything, '[a-m]*' gives me nothing, '[n-z]*' gives me only options
and nothing else (all these with the "-" element appended for debugging
purposes).  Indeed, 'o*' gives me options.  However, '[a-np-z]*' gives
all the matches (other than options) I expect.  Further playing suggests
patterns are just not working how I expect.  Not that I'm particularly
interested in patterns, I'm just trying to narrow down the tags by hook
or by crook and failing dismally.

This is related to stuff down in the bowels where it calls "comptry -m
tag", so I'm unlikely to be able to get to the bottom of this in a
finite lifetime.

pws



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