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

Re: [PATCH] meson: install shell completion scripts

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 17, 2025, 14:31 UTC
Message-ID
<xmqqzfgeeu5g.fsf@gitster.g>
In-Reply-To
<da10dd26-a7bb-474d-8c9a-cac32614d296@gentoo.org>
Eli Schwartz <eschwartz@gentoo.org> writes:
Show 12 quoted lines
> 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.
Show 6 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.

Thanks.
Previous: Eli SchwartzNext: Patrick Steinhardt
Message 6 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.