Re: [PATCH v4] completion: ignore chpwd_functions when cding on zsh

2014-10-16 Thread Øystein Walle
Brandon Turner brandonturner.net> writes: > > On Thu, Oct 9, 2014 at 5:11 PM, Junio C Hamano pobox.com> wrote: > > Actually the patch was slightly wrong. It did not quite matter as > > "cd ''" is a no-op, but "git -C '' cmd" is not that lenient (which > > may be something we may want to fix) a

Re: [PATCH v4] completion: ignore chpwd_functions when cding on zsh

2014-10-09 Thread Brandon Turner
On Thu, Oct 9, 2014 at 5:11 PM, Junio C Hamano wrote: > Actually the patch was slightly wrong. It did not quite matter as > "cd ''" is a no-op, but "git -C '' cmd" is not that lenient (which > may be something we may want to fix) and breaks t9902 by exposing > an existing breakage in the callchai

Re: [PATCH v4] completion: ignore chpwd_functions when cding on zsh

2014-10-09 Thread Junio C Hamano
Brandon Turner writes: > On Thu, Oct 9, 2014 at 3:45 PM, Junio C Hamano wrote: >> >> Bugs are mine; as I do not use zsh myself, some testing is very much >> appreciated. > > I've tested this patch in zsh and it fixes the original problem. I've > also tested various scenarios in bash and zsh (CD

Re: [PATCH v4] completion: ignore chpwd_functions when cding on zsh

2014-10-09 Thread Brandon Turner
On Thu, Oct 9, 2014 at 3:45 PM, Junio C Hamano wrote: > > Bugs are mine; as I do not use zsh myself, some testing is very much > appreciated. I've tested this patch in zsh and it fixes the original problem. I've also tested various scenarios in bash and zsh (CDPATH set, different places within r

Re: [PATCH v4] completion: ignore chpwd_functions when cding on zsh

2014-10-09 Thread Junio C Hamano
Brandon Turner writes: > As Øystein pointed out, on zsh we can use "cd -q" to ignore > chpwd_functions. > > Junio - from my testing, unsetting CDPATH is sufficient on zsh. Let's do this instead, though. Bugs are mine; as I do not use zsh myself, some testing is very much appreciated. Thanks.

Re: [PATCH v4] completion: ignore chpwd_functions when cding on zsh

2014-10-09 Thread Junio C Hamano
Øystein Walle writes: > BUT: Over a year ago Git learned the -C argument. Couldn't we use that > here? That way we would not have to unset CDPATH and can get rid of the > subshell and cd -q. If we allow the other functions to use several > arguments to pass options with we can get rid of the whol

Re: [PATCH v4] completion: ignore chpwd_functions when cding on zsh

2014-10-09 Thread Øystein Walle
Brandon Turner brandonturner.net> writes: > +__git_ls_files_helper () > +{ > + ( > + test -n "${CDPATH+set}" && unset CDPATH > + cd -q "$1" > + if [ "$2" == "--committable" ]; then > + git diff-index --name-only --relative HEAD > +

[PATCH v4] completion: ignore chpwd_functions when cding on zsh

2014-10-09 Thread 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. As I've only seen this so far on ZSH, I'm applying this change only to the git-completion.zsh overrides. Signed-off-by: Brandon Turner --- As Øyste