git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] meson: install shell completion scripts

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 22, 2025, 08:36 UTC
Message-ID
<aAdVCZf58w-_8USV@pks.im>
In-Reply-To
<xmqqzfgeeu5g.fsf@gitster.g>
On Thu, Apr 17, 2025 at 07:31:55AM -0700, Junio C Hamano wrote:
Show 24 quoted lines
> 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.
Show 17 quoted lines
> > 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
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 7 of 8 in “meson: install shell completion scripts”
  1. meson: install shell completion scriptsPatrick Steinhardt, Apr 7, 2025
  2. Akshay HegdeApr 8, 2025
  3. Todd ZullingerApr 8, 2025
  4. Junio C HamanoApr 9, 2025
  5. Eli SchwartzApr 17, 2025
  6. Junio C HamanoApr 17, 2025
  7. Patrick SteinhardtApr 22, 2025
  8. contrib/completion: install Bash completionPatrick Steinhardt, Apr 22, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.