From: Junio C Hamano <gitster@pobox•com>
To: Brandon Turner <bt@brandonturner•net>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] completion: ignore chpwd_functions when cding
Date: Wed, 08 Oct 2014 11:12:41 -0700 [thread overview]
Message-ID: <xmqqh9zebfc6.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1412740394-34061-1-git-send-email-bt@brandonturner.net> (Brandon Turner's message of "Tue, 7 Oct 2014 22:53:14 -0500")
Brandon Turner <bt@brandonturner•net> writes:
> 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>
> ---
Can you mention that this is abomination limited only to zsh
somewhere in the log message? Or does bash share the same glitch?
If this is limited to zsh, I wonder if we can take advantage of the
fact that we have git-completion.bash and git-completion.zsh to
avoid contaminating shared part of the code.
Thanks.
> 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
next prev parent reply other threads:[~2014-10-08 18:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 3:53 [PATCH] completion: ignore chpwd_functions when cding Brandon Turner
2014-10-08 18:12 ` Junio C Hamano [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqh9zebfc6.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=bt@brandonturner$(echo .)net \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox