zsh-users
 help / color / mirror / code / Atom feed
From: Vadim Zeitlin <vz-zsh@zeitlins.org>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re[2]: How to set up completion for git aliases?
Date: Thu, 1 Nov 2012 01:01:23 +0100	[thread overview]
Message-ID: <E1TTiE9-00078G-MY@smtp.tt-solutions.com> (raw)
In-Reply-To: <87liiwtrvw.fsf@ft.bewatermyfriend.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1548 bytes --]

On Sat, 07 Jul 2012 01:02:43 +0200 Frank Terbeck <ft@bewatermyfriend.org> wrote:

FT> Vadim Zeitlin wrote:
FT> >  I have a simple git alias "lg = log --oneline" and I'd like zsh to
FT> > complete it in the same way as it already completes "git log".
...
FT> You don't need to do anything, unless you're on a quite old version of
FT> zsh. The _git completion has support for that out of the box.

 Hello,

 I'd like to return to this thread because I think that this (very useful)
feature doesn't play well with the method of setting up custom completion
for git subcommands described in the standard Completion/Unix/_git: the
comment in the beginning of this file says that you should be able to
simply defined your own _git-foo completion function to handle completion
of "git foo". Unfortunately this doesn't seem to work or, actually, it does
work as long as "foo" is really an external command and not an alias. But
if I have "foo" defined as an alias in my ~/.gitconfig, then it seems that
the alias completion takes over and it tries to complete the "!sh -c ..."
alias expansion which, unsurprisingly, doesn't work really well.

 Is there some way to tell git completion to use _git-foo if it's defined
even if foo is an alias? I tried to find it but unfortunately _git file is
just too much for me...

 Of course, there is always the solution of actually using an external
command instead of an alias but having an alias is often more convenient
for simple one-liners so it would be nice if it could be made to work.

 Thanks in advance,
VZ

[-- Attachment #2: Type: APPLICATION/PGP-SIGNATURE, Size: 196 bytes --]

  parent reply	other threads:[~2012-11-01  0:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 17:04 Vadim Zeitlin
2012-07-06 17:56 ` Axel Beckert
2012-07-06 23:02 ` Frank Terbeck
2012-07-07  0:52   ` Re[2]: " Vadim Zeitlin
2012-07-17 19:20     ` Axel Beckert
2012-07-17 19:54       ` Frank Terbeck
2012-11-01  0:01   ` Vadim Zeitlin [this message]
2012-11-01  4:46     ` Re[2]: " Benjamin R. Haskell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1TTiE9-00078G-MY@smtp.tt-solutions.com \
    --to=vz-zsh@zeitlins.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).