Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: (0/3) _git fixes and enhancements



Hey list!

This is a small series that (hopefully) improves _git a little.


_git: Fall back to file completion if nothing else works

    The first patch does basically the same as the one from
    workers-29512 did. But on IRC Mikael reminded me of workers-29453,
    which basically makes the point that most sub-command completions
    are not suited to be used with `_call_function', since they set
    `ret' themselves.

    Therefore, the second patch removes the use of `_call_function' and
    just calls the sub-command completion directly (just like Mikael did
    in `workers-29453').

    The file-completion fallback is only used if `_git-foo()' is not
    defined. So, the completion behaviour of know sub-commands does
    *not* change at all.

    workers-29512: <http://www.zsh.org/mla/workers/2011/msg00946.html>
    workers-29453: <http://www.zsh.org/mla/workers/2011/msg00887.html>


_git: Pick up addon completions from $fpath

    The second patch goes ahead and collects all `_git-*' completion
    files from `$fpath' and makes them available for:

    % git <tab>

    There is optional support for specifying a description for the addon
    command in the second line of the function if file, if that second
    line matches "#desc:*". Such a completion may look like this (say,
    this is a file called `_git-foo'):

    [snip]
    #compdef git-foo
    #desc:checks git's foobar value
    [...]
    [snap]

    With this, the patch from workers-29514 isn't needed anymore. I'll
    drop it therefore.


_git: re-add `user-commands' support again

    The third patch just re-adds the use of the `user-commands' style
    like it's documented on top of `_git'. This (probably) got
    accidentally dropped when Nikolai did the major `_git'-update.


 Completion/Unix/Command/_git |   50 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 1 deletions(-)



Messages sorted by: Reverse Date, Date, Thread, Author