From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10923 invoked by alias); 1 Nov 2012 00:37:39 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17369 Received: (qmail 27108 invoked from network); 1 Nov 2012 00:37:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at zeitlins.org does not designate permitted sender hosts) Message-Id: Date: Thu, 1 Nov 2012 01:01:23 +0100 From: Vadim Zeitlin Subject: Re[2]: How to set up completion for git aliases? To: Zsh Users MIME-Version: 1.0 Content-Type: MULTIPART/SIGNED; protocol="application/pgp-signature"; micalg=pgp-sha1; BOUNDARY="165267574-41-1351728083=:7424" References: <87liiwtrvw.fsf@ft.bewatermyfriend.org> In-Reply-To: <87liiwtrvw.fsf@ft.bewatermyfriend.org> X-Mailer: Mahogany 0.68.0 'Cynthia', running under Windows 7 (build 7601, Service Pack 1), 64-bit edition --165267574-41-1351728083=:7424 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-Disposition: INLINE On Sat, 07 Jul 2012 01:02:43 +0200 Frank Terbeck 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 --165267574-41-1351728083=:7424 Content-Type: APPLICATION/PGP-SIGNATURE -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iEYEABECAAYFAlCRu9MACgkQBupB3k9sHoaKuACfaMqyfB2aSwlzXjBbutWODbVC FwcAoKCUOgsg4j2Tu44yLQwJcUg0t0R5 =TntE -----END PGP SIGNATURE----- --165267574-41-1351728083=:7424--