diff --git a/git-prompt b/git-prompt new file mode 100644 index 0000000..2147d10 --- /dev/null +++ b/git-prompt @@ -0,0 +1,11 @@ +# In git versions < 1.7.12, this shell library was part of the +# git completion script. +# +# Some users rely on the __git_ps1 function becoming available +# when bash-completion is loaded. Continue to load this library +# at bash-completion startup for now, to ease the transition to a +# world order where the prompt function is requested separately. +# +if [[ -e /usr/share/bash-completion/completions/git-prompt.sh ]]; then + . /usr/share/bash-completion/completions/git-prompt.sh +fi diff --git a/git.changes b/git.changes index 496daff..d55e229 100644 --- a/git.changes +++ b/git.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Jul 8 09:00:10 UTC 2022 - Petr Vorel + +- Add /etc/bash_completion.d/git-prompt: checks for git-prompt.sh and source it + if available. Some users rely on the __git_ps1 function becoming available + when bash-completion is loaded. Continue to load this library at + bash-completion startup for now, to ease the transition to a world order + where the prompt function is requested separately. Inspired by Debian. + ------------------------------------------------------------------- Thu Jul 7 07:50:07 UTC 2022 - Danilo Spinella diff --git a/git.spec b/git.spec index 1e027ed..0305998 100644 --- a/git.spec +++ b/git.spec @@ -53,6 +53,7 @@ Source8: %{name}.keyring Source9: %{name}-gui.desktop Source10: %{name}-gui.png Source11: git-daemon.conf +Source12: git-prompt Patch3: completion-wordbreaks.diff # CVE-2011-2186, bnc#698456 Patch4: git-prevent_xss-default.diff @@ -399,6 +400,8 @@ find %{buildroot}/%{_mandir} -type f -exec chmod 644 "{}" "+" %endif install -m 644 -D contrib/completion/git-completion.bash %{buildroot}%{_datadir}/bash-completion/completions/git install -m 644 -D contrib/completion/git-prompt.sh %{buildroot}%{_datadir}/bash-completion/completions/git-prompt.sh +mkdir -p %{buildroot}/%{_sysconfdir}/bash_completion.d/ +install -m 644 %{SOURCE12} %{buildroot}/%{_sysconfdir}/bash_completion.d/git-prompt # contrib/credential %if %{with git_gnome_keyring} install -m 755 -D contrib/credential/gnome-keyring/git-credential-gnome-keyring %{buildroot}/%{gitexecdir}/git-credential-gnome-keyring @@ -569,6 +572,7 @@ fi %exclude %{gitexecdir}/git-add--interactive %{_bindir}/git-new-workdir %{_datadir}/bash-completion/completions/* +%{_sysconfdir}/bash_completion.d/git-prompt %{_datadir}/tcsh %{_datadir}/zsh/site-functions/_git %{_sysconfdir}/profile.d/*.csh