git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: Eli Schwartz <eschwartz@gentoo.org>,
	Todd Zullinger <tmz@pobox.com>,
	Akshay Hegde <lists+git@akshay.is>,
	git@vger.kernel.org
Subject: Re: [PATCH] meson: install shell completion scripts
Date: Tue, 22 Apr 2025 10:36:25 +0200	[thread overview]
Message-ID: <aAdVCZf58w-_8USV@pks.im> (raw)
In-Reply-To: <xmqqzfgeeu5g.fsf@gitster.g>

On Thu, Apr 17, 2025 at 07:31:55AM -0700, Junio C Hamano wrote:
> Eli Schwartz <eschwartz@gentoo.org> writes:
> 
> > bash-completion looks for scripts in a few different places, with a
> > common theme that there is a "datadir" followed by the literal path
> > bash-completion/completions -- some values for the datadir:
> > ...
> > ... since as long as you leave meson
> > datadir and bindir alone you can install into absolutely any prefix, no
> > matter how weird, and successfully invoking `git` itself will as a side
> > effect add the correct bash completion file.
> >
> > And that also means that distros automatically do the right thing --
> > just configure with prefix=/usr and we get
> > /usr/share/bash-completion/completions as expected
> 
> OK, so that is clear and easy.  Next to where we have
> 
>     infodir = $(prefix)/share/info
> 
> we add
> 
>     bash_completion_dir = $(prefix)/share/bash-completion/completions
> 
> and everybody would be happy.  We do the parallel on the meson side.

Okay, makes sense.

> > With zsh, things are a lot shakier. ...
> > ... (a lot of explanation on zsh installation path quirks omitted)
> > So, my personal feelings on this patch are that we can and should
> > unambiguously install the bash completion, but it would be reasonable to
> > defer handling zsh until someone figures out how to do it correctly,
> > which may be impossible.
> 
> Sounds good.  Or just use
> 
>     zsh_completion_dir = $(prefix)/share/zsh/site-functions
> 
> perhaps.  Those who are making personal installation under $HOME at
> least would know that what they have under $prefix mirrors the
> /usr/{bin,lib,share,....}/ if things were installed for host, so
> even though zsh does not look into there, at least the layout would
> be familiar to the user.  But I am even happier if we decide to
> leave it out as you suggested.

Okay, I'll leave zsh out then. We can still add it at a later point in
time if it ever becomes clear what we should be doing.

Patrick

  reply	other threads:[~2025-04-22  8:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  7:42 [PATCH] meson: install shell completion scripts Patrick Steinhardt
2025-04-08  0:00 ` Akshay Hegde
2025-04-08  2:26   ` Todd Zullinger
2025-04-09 17:42     ` Junio C Hamano
2025-04-17  3:58       ` Eli Schwartz
2025-04-17 14:31         ` Junio C Hamano
2025-04-22  8:36           ` Patrick Steinhardt [this message]
2025-04-22  8:36 ` [PATCH v2] contrib/completion: install Bash completion 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=aAdVCZf58w-_8USV@pks.im \
    --to=ps@pks.im \
    --cc=eschwartz@gentoo.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).