On Wed, 2 Jan 2013, Vincent Driessen wrote:

> Hellow fellow fishers,
> 
> My question is short: what is the best way to implement support for command
> completions when using git aliases?
> 
> For example, I've a (git-defined) alias for checkout, via
> 
>     git config --global alias.co checkout
> 
> When typing "git co <TAB>", I want to have that expand to every available
> branch/tag, as if I typed "git checkout <TAB>".
> 
> Currently, I'm copying all the git completions over to a local version for
> the aliases, but that approach is pretty lame.
> 
> Is it possible to do alias detection/completion automatically in a
> non-hacky way?

Hmm, interesting question.

You can use something like `git config --get-regexp alias.\*` to get 
output along the lines of:

alias.tree log --graph --decorate ...

Without Github issue #165/#393 being fixed, I can't think of an easy way 
of getting any further than that though.

One useful first step might be adding a '--print' option to `complete` 
which would output the current completion for a command.

Sorry!

David Adam
zanc...@ucc.gu.uwa.edu.au

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to