From: Patrick Steinhardt <ps@pks.im>
To: Todd Zullinger <tmz@pobox.com>
Cc: Akshay Hegde <lists+git@akshay.is>, git@vger.kernel.org
Subject: Re: meson: Installing completions
Date: Wed, 2 Apr 2025 13:33:59 +0200 [thread overview]
Message-ID: <Z-0gpxXBmt8G72Z9@pks.im> (raw)
In-Reply-To: <Z-yLvgkJnGm0CkG3@teonanacatl.net>
On Tue, Apr 01, 2025 at 08:58:38PM -0400, Todd Zullinger wrote:
> Akshay Hegde wrote:
> > On 2025-04-01 11:58 +0200, Patrick Steinhardt wrote:
> >>The biggest question though is whether distros are aligned enough for us
> >>to provide standard installation paths. That is, do all distros end up
> >>installing bash completion into "/usr/share/bash-completion"? What are
> >>the desired directories for tcsh and zsh completion?
> >>
> >>If there is enough standardization then yes, I totally think we should
> >>start installing completion scripts automatically.
> >
> > Well I can't speak from any sort of authoritativeness here, but for zsh,
> > they are usually installed underneath the datadir (usually /usr/share),
> > then under zsh/site-functions. Of course, I don't know if that's true
> > for all distros.
> >
> > Could we extend meson_options to allow specification of bash/tcsh/zsh
> > completion directories? If they are not empty, I think it would be
> > reasonable to have meson install it automatically.
>
> Having the ability to specify the install path seems like
> the way to go, even if the default is used by most systems.
> For Fedora, only the bash and tcsh completions are
> installed. The latter is simply placed in:
>
> /usr/share/git-core/contrib/completion/git-completion.tcsh
>
> and users need to make some adjustments to their startup
> scripts to use it, as documented in the file. This was
> added to the Fedora packages in:
>
> commit dae8588
> Author: Todd Zullinger <tmz@pobox.com>
> Date: Thu Jan 3 14:59:27 2013 -0500
>
> For now, this just gets the file from contrib installed. If there are
> enough tcsh users that want it to be more automated, that can come
> later. For now, the directions in the file must be followed to enable
> tcsh completion.
>
> In the years I maintained git in Fedora, no one asked for
> any changes for tcsh. Apparently, either no one uses that
> or they don't mind the manual work to configure it. :)
One of the questions is whether we gain a lot by making this an option.
If packagers have to manually adapt the location they could just as well
copy the file by hand as there is no build step involved in the first
place. I also think that for Bash and zsh the locations are somewhat
stable across distros these days, so ideally we could just build on that
and not even provide an option in the first place?
I'm mostly trying to avoid to eventually end up with tons of build
options. Ideally, we should just do the right thing and install the
completion scripts into the correct location in the specified prefix.
At least if we can get away with it. It seems like the default location
would work alright for you on Fedora, and I assume that it would work
alright for most of the other distros. So I'd refrain from introducing
an option now, but if we eventually figure out that this is problematic
on some distro then we can still introduce the option at a later point
in time.
> IIRC, there are git completions installed by upstream zsh
> and installing git-completion.zsh site-wide is not generally
> agreed that everyone wants? I'm not a zsh user, but I think
> that's why I never installed it in the Fedora git packaging.
> (It does seem like an oversight that they aren't at least
> installed similarly to the tcsh completion.)
>
> For reference, here are the locations for bash, fish, and
> zsh which Fedora uses. This might be helpful in determining
> reasonable defaults (after comparing to other distributions,
> of course):
>
> bash /usr/share/bash-completion/completions
> fish /usr/share/fish/vendor_completions.d
> zsh /usr/share/zsh/site-functions
We don't have completions for the Fish shell, right? Just making sure
that I don't miss the obvious.
Patrick
next prev parent reply other threads:[~2025-04-02 11:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 6:46 meson: Installing completions Akshay Hegde
2025-04-01 9:58 ` Patrick Steinhardt
2025-04-01 17:43 ` Akshay Hegde
2025-04-02 0:58 ` Todd Zullinger
2025-04-02 11:33 ` Patrick Steinhardt [this message]
2025-04-02 14:05 ` Todd Zullinger
2025-04-07 8:01 ` Patrick Steinhardt
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=Z-0gpxXBmt8G72Z9@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=lists+git@akshay.is \
--cc=tmz@pobox.com \
/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.
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).