zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] Remove redundancies from `git` completion
Date: Thu, 02 Sep 2021 22:51:07 +0200	[thread overview]
Message-ID: <55401-1630615867.120247@EZKa.ra6F.k6mM> (raw)
In-Reply-To: <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@brasslantern.com> 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


  reply	other threads:[~2021-09-02 20:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 11:17 Marlon Richert
2021-08-30 11:41 ` Mikael Magnusson
2021-08-30 12:34   ` Marlon Richert
2021-08-30 12:42     ` Mikael Magnusson
2021-08-31  5:52       ` Marlon Richert
2021-09-01 14:03         ` Daniel Shahaf
2021-09-01 18:22           ` Bart Schaefer
2021-09-02  6:17             ` Marlon Richert
2021-09-02 20:51               ` Oliver Kiddle [this message]
2021-09-02 20:54                 ` Bart Schaefer
2021-09-02 21:17                   ` Oliver Kiddle
2021-09-01 13:56 ` Daniel Shahaf
2021-09-02  8:57   ` Marlon Richert

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=55401-1630615867.120247@EZKa.ra6F.k6mM \
    --to=opk@zsh.org \
    --cc=zsh-workers@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).