Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Remove redundancies from `git` completion
- X-seq: zsh-workers 49371
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Remove redundancies from `git` completion
- Date: Thu, 02 Sep 2021 22:51:07 +0200
- Archived-at: <https://zsh.org/workers/49371>
- In-reply-to: <CAHLkEDvnETmxUWen-o=oZtxDpfsZc3zNH2940j_6=7r4w=L+Fw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDt9=VdVFqvvwUfXb8HBO_uxZAnaS7f_gtBTSHy_XLMWsg@mail.gmail.com> <CAHYJk3SpQ1KibJtbjOvEputdVL3XEeJywKewk-xxEgZxgLXowg@mail.gmail.com> <CAHLkEDtu9ABHKC4JXn9s3DkKvh7me=s1x=EBV3ibr+dnUwbj9w@mail.gmail.com> <CAHYJk3Qf5W2TY0u03bS7wUzR9Q8iXtwmpDRG8o8nTRCaBgMT1g@mail.gmail.com> <CAHLkEDu=hm77q1idtFg5PhPeh9FmxrvPOgrutz-Eaz0UBM_g9Q@mail.gmail.com> <20210901140327.GB27958@tarpaulin.shahaf.local2> <CAH+w=7aB4QALHV0X5Q0fHeQQw=q+a9yP5-Kv7rRn5iOd131xhg@mail.gmail.com> <CAHLkEDvnETmxUWen-o=oZtxDpfsZc3zNH2940j_6=7r4w=L+Fw@mail.gmail.com>
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