git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] completion: ignore chpwd_functions when cding
@ 2014-10-08  3:53 Brandon Turner
  2014-10-08 18:12 ` Junio C Hamano
  0 siblings, 1 reply; 16+ messages in thread
From: Brandon Turner @ 2014-10-08  3:53 UTC (permalink / raw)
  To: git; +Cc: Brandon Turner

Software, such as RVM (ruby version manager), may set chpwd functions
that result in an endless loop when cding.  chpwd functions should be
ignored.

Signed-off-by: Brandon Turner <bt@brandonturner.net>
---
For an example of this bug, see:
https://github.com/wayneeseguin/rvm/issues/3076

 contrib/completion/git-completion.bash | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 06bf262..996de31 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -283,7 +283,8 @@ __git_ls_files_helper ()
 {
 	(
 		test -n "${CDPATH+set}" && unset CDPATH
-		cd "$1"
+		(( ${#chpwd_functions} )) && chpwd_functions=()
+		builtin cd "$1"
 		if [ "$2" == "--committable" ]; then
 			git diff-index --name-only --relative HEAD
 		else
-- 
2.1.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-10-16 18:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08  3:53 [PATCH] completion: ignore chpwd_functions when cding Brandon Turner
2014-10-08 18:12 ` Junio C Hamano
2014-10-08 21:49   ` [PATCH v2] " Brandon Turner
2014-10-08 21:49   ` [PATCH v3] completion: ignore chpwd_functions when cding on zsh Brandon Turner
2014-10-09  7:34     ` Øystein Walle
2014-10-09 18:10       ` Junio C Hamano
2014-10-09 19:01         ` [PATCH v4] " Brandon Turner
2014-10-09 19:47           ` Øystein Walle
2014-10-09 20:01             ` Junio C Hamano
2014-10-09 20:45           ` Junio C Hamano
2014-10-09 22:04             ` Brandon Turner
2014-10-09 22:11               ` Junio C Hamano
2014-10-09 22:30                 ` Brandon Turner
2014-10-16 18:10                   ` Øystein Walle
2014-10-09 19:21         ` [PATCH v3] " Øystein Walle
2014-10-08 21:50   ` [PATCH] completion: ignore chpwd_functions when cding Brandon Turner

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).