Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: tag-order with git refs
On Thu, 8 Oct 2015 00:22:31 +0200
Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Peter wrote:
> > How do I limit completion after "git checkout" to showing local heads
> > first (i.e. branches I actually use)?
> >
> > zstyle ':completion:*:complete:git-checkout:*' tag-order heads-local
>
> There are several nested tag loops in _git. In such cases, I find it
> works better to list all tags along the path:
> zstyle ':completion:*:complete:git-checkout:*' tag-order 'tree-ishs heads heads-local'
Aha, that's already a good start. I'm starting to see why the patterns
did bizarre things --- I wasn't banking on needing multiple tag matches
to get a single completion.
Sounds like there are at least some possibilities for improving this,
but I wonder if we can make ^xh a bit more helpful about what you
actually need to do in a particular case? That would save a lot of
documentation for a lot of completions. It's sort of mentioning the
right words but doesn't give any help about how you need to combine
them. If we could make it build up a "story so far" string and output
it at the end, or something like that...?
> This has limitations. _next_tags will advance within inner tag loops
> first before tracking back to outer ones. There are other irritations here
> like ORIG_HEAD making it hard to complete origin/ given case-insensitive
> matching control.
And I'm getting completions for heads-remote, somehow (that's before
your patch, at least). Oooh...
zstyle ':completion:*:complete:git-checkout:*' ignored-patterns '*/*'
With the _ignored completer that does something like what I want.
Thanks
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author