debian: package git-prompt script (get __git_ps1 working again)
Danny Yates writes:
> I've recently upgraded git on an Oneiric server to
> 1:1.8.0-0ppa1~oneiric1, and seem to have lost the __git_ps1 function. It
> used to be in /etc/bash_completion.d/git.
__git_ps1 has been split out from the main completion script into a
separate git-prompt.sh library (see v1.7.12-rc0~67^2~2, 2012-05-22)
and unfortunately there is no standard place to install it.
This patch takes the following approach:
* install contrib/completion/git-prompt.sh to
$(gitexecdir)/git-sh-prompt, which based on upstream discussion
is at least a possible place for that script.
* source git-sh-prompt in /etc/bash_completion.d/git-prompt so
existing configurations that relied on __git_ps1 becoming available
when bash-completion is loaded continue to work without fuss.
* no NEWS entry yet. We can add one encouraging users to update
their configuration once the filename for the git-prompt scriptlet
has been decided.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
diff --git a/debian/git-prompt.completion b/debian/git-prompt.completion
new file mode 100644
index 0000000..6a31546
--- /dev/null
+++ b/debian/git-prompt.completion
@@ -0,0 +1,9 @@
+# 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.
+#
+. /usr/lib/git-core/git-sh-prompt