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

Re: [PATCH] Remove redundancies from `git` completion



Marlon Richert wrote:
> On Wed, Sep 1, 2021 at 9:23 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > It would be nice if e.g. «autoload $HOME/gitfuncs/_git_foo» were
> > sufficient, but the explicit definition of _git_foo inside _git will
> > clobber that autoload.
>
> Moving all _git_foo functions from the _git file into separate,
> #autoload files would solve that.

The existing (( $+functions[_git-foo] )) || test also solves it. The
only thing you need do is put your overrides in $fpath.

In practice, I doubt many people ever do. And if they do, we've probably
done a poor job somewhere.

This function existence check is not a pattern I followed elsewhere.
There are a few things that were done somewhat differently in _git
compared to other functions and some of that has been copied. I don't
see the point in the double initial underscore naming on some functions.
This particular test was rather annoying before $functions_source
existed because it made it more difficult to fully reload all _git
functions.

Oliver




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