From: Akshay Hegde <lists+git@akshay.is>
To: git@vger.kernel.org
Cc: Patrick Steinhardt <ps@pks.im>, Todd Zullinger <tmz@pobox.com>
Subject: Re: [PATCH] meson: install shell completion scripts
Date: Mon, 7 Apr 2025 17:00:36 -0700 [thread overview]
Message-ID: <Z_RnJEyvtGh_0kFo@akshay.is> (raw)
In-Reply-To: <20250407-b4-pks-meson-install-completions-v1-1-8a7eb8b9284b@pks.im>
Hi Patrick,
On 2025-04-07 09:42 +0200, Patrick Steinhardt wrote:
> Hi,
>
> this patch is a result from the discussion at [1]. Thanks!
>
> Patrick
>
> [1]: <Z-uLqQd7QHZq-tB7@akshay.is>
Awesome, thanks for the patch! I applied it on top of git 2.49.0 and can
confirm completion scripts get auto-installed at their appropriate
locations under datadir. The datadir can also be customized by passing
in '-Ddatadir' to `meson setup` so it's pretty flexible.
One thing of note is that the git completion script for zsh also depends
on the bash completion script.
So if you use a non-standard install location like I do (I'm pretty
weird, I use macOS with a package manager I've written myself), you'll
get an error with the git completion not being able to find the bash
script. The fix is to tell zsh where the bash completion script is
located. This is also helpfully communicated in the completion script
for zsh:
# You need git's bash completion script installed. By default bash-completion's
# location will be used (e.g. pkg-config --variable=completionsdir bash-completion).
#
# If your bash completion script is somewhere else, you can specify the
# location in your ~/.zshrc:
#
# zstyle ':completion:*:*:git:*' script ~/.git-completion.bash
Adding the zstyle line to my ~/.zshrc made the completion script work
without issues.
Most people won't run into this since if you have this installed in the
standard locations, it should just work, and the zsh script does have
logic to look for additional paths it may be under. I just wanted to
mention it for info.
Cheers,
--
Akshay
next prev parent reply other threads:[~2025-04-08 0:00 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 [this message]
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
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=Z_RnJEyvtGh_0kFo@akshay.is \
--to=lists+git@akshay.is \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
--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).