summaryrefslogtreecommitdiff
path: root/t/t9903-bash-prompt.sh
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2012-05-22 20:46:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-22 22:35:02 (GMT)
commitaf31a456b4cd38f2630ed8e556e23954f806a3cc (patch)
tree08af8712a91e1f5e857d8ad5bfec185dc1b39207 /t/t9903-bash-prompt.sh
parent1098ff5a213265bb0d5df9a87d5493bd168f12a0 (diff)
downloadgit-af31a456b4cd38f2630ed8e556e23954f806a3cc.zip
git-af31a456b4cd38f2630ed8e556e23954f806a3cc.tar.gz
git-af31a456b4cd38f2630ed8e556e23954f806a3cc.tar.bz2
completion: split __git_ps1 into a separate script
bash-completion 1.90 shipped with support to load completions dynamically[1], which means the git completion script wouldn't be loaded until the user types 'git <tab>'--this creates a problem to people using __git_ps1(); that function won't be available when the shell is first created. For now distributions have workarounded this issue by moving the git completion to the "compatdir"[2]; this of course is not ideal. The solution, proposed by Kerrick Staley[3], is to split the git script in two; the part that deals with __git_ps1() in one (i.e. git-prompt.sh), and everything else in another (i.e. git-completion.bash). Another benefit of this is that zsh user that are not interested in the bash completion can use it for their prompts, which has been tried before[4]. The only slight issue is that __gitdir() would be duplicated, but this is probably not a big deal. So let's go ahead and move __git_ps1() to a new file. While at this, I took the liberty to reformat the help text in the new file. [1] http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=99c4f7f25f50a7cb2fce86055bddfe389effa559 [2] http://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/git&id=974380fabb8f9f412990b17063bf578d98c44a82 [3] http://mid.gmane.org/CANaWP3w9KDu57aHquRRYt8td_haSWTBKs7zUHy-xu0B61gmr9A@mail.gmail.com [4] http://mid.gmane.org/1303824288-15591-1-git-send-email-mstormo@gmail.com Cc: Kerrick Staley <mail@kerrickstaley.com> Cc: Marius Storm-Olsen <mstormo@gmail.com> Cc: Ville Skyttä <ville.skytta@iki.fi> Cc: Dan McGee <dan@archlinux.org> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9903-bash-prompt.sh')
-rwxr-xr-xt/t9903-bash-prompt.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index a6c9ce9..f8fb93f 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -7,7 +7,7 @@ test_description='test git-specific bash prompt functions'
. ./lib-bash.sh
-. "$GIT_BUILD_DIR/contrib/completion/git-completion.bash"
+. "$GIT_BUILD_DIR/contrib/completion/git-prompt.sh"
actual="$TRASH_DIRECTORY/actual"