From: "Benjamin R. Haskell" <zsh@benizi.com>
To: zsh-users@zsh.org
Subject: Re: Use helper functions for git completion in my own completions
Date: Tue, 18 Oct 2011 16:05:35 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.01.1110181600400.23569@hp.internal> (raw)
In-Reply-To: <87mxcyv6u6.fsf@deep-thought.43-1.org>
On Tue, 18 Oct 2011, Ansgar Burchardt wrote:
> Hi,
>
> is it possible to use the helper functions defined in "_git" for the
> git command in my own completion functions?
Yes, though with the recent(-ish) rewrite (and in general), I'm not sure
there's really a stable API.
E.g. if __git_pattern_escape isn't needed by _git anymore, I suspect it
would simply disappear. As would __git_commits2, or whatnot.
> I am taking my first steps with writing completions for the
> git-import-dsc, git-import-orig commands in Debian, but am not surehow
> I can make sure helper functions such as __git_branch_names are
> available when I user "git-import-dsc" (they are available when I use
> "git import-dsc").
If you create the _git-{command-name} function (e.g. _git-import-dsc),
it will be used by _git (at least by the version of _git I'm currently
using). By virtue of being used from within _git, all of the helper
functions will exist, because they're defined when _git is autoloaded.
--
Best,
Ben
next prev parent reply other threads:[~2011-10-18 20:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-18 12:10 Ansgar Burchardt
2011-10-18 14:58 ` Julien Nicoulaud
2011-10-18 18:50 ` Oliver Kiddle
2011-10-18 20:05 ` Benjamin R. Haskell [this message]
2011-10-18 20:28 ` Nikolai Weibull
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=alpine.LNX.2.01.1110181600400.23569@hp.internal \
--to=zsh@benizi.com \
--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).