zsh-users
 help / color / mirror / code / Atom feed
* git push completion
@ 2014-06-30  9:22 Sebastian Stark
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Stark @ 2014-06-30  9:22 UTC (permalink / raw)
  To: zsh-users

Hi,

if I autocomplete on "git push <tab>" it will give me like hundreds of
hosts (I guess it's the generic _hosts completion) along with my
configured remotes.

How can I tell the completion system to only offer the configured
remotes, I never push to other servers.


Thanks,
Sebastian


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git push completion
  2014-06-30 10:01 Sebastian Stark
@ 2014-06-30 10:20 ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2014-06-30 10:20 UTC (permalink / raw)
  To: zsh-users

On Mon, 30 Jun 2014 12:01:40 +0200
Sebastian Stark <seb-zsh@biskalar.de> wrote:
> if I autocomplete on "git push <tab>" it will give me like hundreds of
> hosts (I guess it's the generic _hosts completion) along with my
> configured remotes.
> 
> How can I tell the completion system to only offer the configured
> remotes, I never push to other servers.

There's a recipe for this sort of thing.

- Type ^xh where you'd usually complete.

- Look at the output and decide which is the completion you really want
to see.  Here the answer appears to be

tags in context :completion::complete:git-push:argument-1:
 ...
    remotes                                         (__git_remotes _alternative __git_any_repositories _arguments _git-push _call_function _git) 

- You need to set a tag-order style for this context that puts that
tag, "remotes", first.

zstyle ':completion:*:git-push:*' tag-order remotes '*'

- Now you find that all though that makes a difference it doesn't
actually quite do what you were expecting --- in fact, the only thing it
seems to get rid of in my case is local respositories, leaving commit
tags and hosts.  You then wait for someone to work out why.  We're now
at this stage :-).

pws


^ permalink raw reply	[flat|nested] 3+ messages in thread

* git push completion
@ 2014-06-30 10:01 Sebastian Stark
  2014-06-30 10:20 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Stark @ 2014-06-30 10:01 UTC (permalink / raw)
  To: zsh-users

Hi,

if I autocomplete on "git push <tab>" it will give me like hundreds of
hosts (I guess it's the generic _hosts completion) along with my
configured remotes.

How can I tell the completion system to only offer the configured
remotes, I never push to other servers.


Thanks,
Sebastian


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-30 10:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30  9:22 git push completion Sebastian Stark
2014-06-30 10:01 Sebastian Stark
2014-06-30 10:20 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).