commit:     461becdf9c346a56d88d4afbba0b3ca1468797a5
Author:     D. Ben Knoble <ben.knoble+github <AT> gmail <DOT> com>
AuthorDate: Tue Nov  4 02:14:48 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 17 07:39:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=461becdf

dev-vcs/git: install upstream Zsh completions

Administrators can still filter out these completions with INSTALL_MASK,
and users or admins can adjust fpath if desired.

Whatever is earlier in fpath (that is, the first hit for
`ls $^fpath/_git`) wins. Git's completion goes to
/usr/share/zsh/site_functions or something similar, which is early on
the system fpath to allow overrides; meanwhile Zsh's completion is
fairly late on the default fpath.

So installing unconditionally means Git's script wins, without the
aforementioned customization.

Closes: https://bugs.gentoo.org/961079
Signed-off-by: D. Ben Knoble <ben.knoble+github <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44459
Closes: https://github.com/gentoo/gentoo/pull/44459
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-vcs/git/git-2.49.1.ebuild    | 11 ++++++++++-
 dev-vcs/git/git-2.50.1.ebuild    | 11 ++++++++++-
 dev-vcs/git/git-2.51.0.ebuild    | 11 ++++++++++-
 dev-vcs/git/git-2.51.1.ebuild    | 11 ++++++++++-
 dev-vcs/git/git-2.51.2-r1.ebuild | 11 ++++++++++-
 dev-vcs/git/git-9999-r1.ebuild   | 11 ++++++++++-
 dev-vcs/git/git-9999-r2.ebuild   | 11 ++++++++++-
 dev-vcs/git/git-9999-r3.ebuild   | 11 ++++++++++-
 dev-vcs/git/git-9999.ebuild      | 11 ++++++++++-
 9 files changed, 90 insertions(+), 9 deletions(-)

diff --git a/dev-vcs/git/git-2.49.1.ebuild b/dev-vcs/git/git-2.49.1.ebuild
index 30d30860bda5..616fe9887412 100644
--- a/dev-vcs/git/git-2.49.1.ebuild
+++ b/dev-vcs/git/git-2.49.1.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -372,6 +372,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -500,6 +501,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

diff --git a/dev-vcs/git/git-2.50.1.ebuild b/dev-vcs/git/git-2.50.1.ebuild
index 59eec62eb112..7d4a8a9f9b64 100644
--- a/dev-vcs/git/git-2.50.1.ebuild
+++ b/dev-vcs/git/git-2.50.1.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -364,6 +364,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -493,6 +494,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

diff --git a/dev-vcs/git/git-2.51.0.ebuild b/dev-vcs/git/git-2.51.0.ebuild
index 9a2e92d89e96..b77049620ded 100644
--- a/dev-vcs/git/git-2.51.0.ebuild
+++ b/dev-vcs/git/git-2.51.0.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -354,6 +354,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -470,6 +471,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

diff --git a/dev-vcs/git/git-2.51.1.ebuild b/dev-vcs/git/git-2.51.1.ebuild
index c4c40fbed1a6..45129ae90863 100644
--- a/dev-vcs/git/git-2.51.1.ebuild
+++ b/dev-vcs/git/git-2.51.1.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -356,6 +356,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -472,6 +473,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

diff --git a/dev-vcs/git/git-2.51.2-r1.ebuild b/dev-vcs/git/git-2.51.2-r1.ebuild
index 3de51238c45f..a063ebf119e5 100644
--- a/dev-vcs/git/git-2.51.2-r1.ebuild
+++ b/dev-vcs/git/git-2.51.2-r1.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -354,6 +354,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -470,6 +471,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

diff --git a/dev-vcs/git/git-9999-r1.ebuild b/dev-vcs/git/git-9999-r1.ebuild
index 68a5ad083cec..510dd57b7512 100644
--- a/dev-vcs/git/git-9999-r1.ebuild
+++ b/dev-vcs/git/git-9999-r1.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -350,6 +350,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -466,6 +467,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

diff --git a/dev-vcs/git/git-9999-r2.ebuild b/dev-vcs/git/git-9999-r2.ebuild
index 68a5ad083cec..510dd57b7512 100644
--- a/dev-vcs/git/git-9999-r2.ebuild
+++ b/dev-vcs/git/git-9999-r2.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -350,6 +350,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -466,6 +467,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

diff --git a/dev-vcs/git/git-9999-r3.ebuild b/dev-vcs/git/git-9999-r3.ebuild
index 68a5ad083cec..510dd57b7512 100644
--- a/dev-vcs/git/git-9999-r3.ebuild
+++ b/dev-vcs/git/git-9999-r3.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -350,6 +350,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -466,6 +467,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

diff --git a/dev-vcs/git/git-9999.ebuild b/dev-vcs/git/git-9999.ebuild
index 3de51238c45f..a063ebf119e5 100644
--- a/dev-vcs/git/git-9999.ebuild
+++ b/dev-vcs/git/git-9999.ebuild
@@ -8,7 +8,7 @@ GENTOO_DEPEND_ON_PERL=no
 # bug #329479: git-remote-testgit is not multiple-version aware
 PYTHON_COMPAT=( python3_{11..14} )
 
-inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale 
python-single-r1 systemd meson
+inherit toolchain-funcs perl-module shell-completion optfeature plocale 
python-single-r1 systemd meson
 
 PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
 
@@ -354,6 +354,7 @@ src_install() {
 
        newbashcomp contrib/completion/git-completion.bash ${PN}
        bashcomp_alias git gitk
+       newzshcomp contrib/completion/git-completion.zsh _${PN}
        # Not really a bash-completion file (bug #477920)
        # but still needed uncompressed (bug #507480)
        insinto /usr/share/${PN}
@@ -470,6 +471,14 @@ pkg_postinst() {
                elog "Note that the prompt bash code is now in that separate 
script"
        fi
 
+       if has_version app-shells/zsh ; then
+               elog 'There are two competing zsh completions available for 
Git.'
+               elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+               elog 'To choose between them, order the entries of $fpath so 
that your'
+               elog 'desired completion is earlier in the list or symlink the 
relevant'
+               elog 'script into a personal override directory early on fpath.'
+       fi
+
        optfeature_header "Some scripts require additional dependencies:"
        optfeature git-quiltimport dev-util/quilt
        optfeature git-instaweb www-servers/lighttpd www-servers/apache 
www-servers/nginx

Reply via email to