[RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Matthieu Moy
The function-wide redirection used for __git_ls_files_helper and __git_diff_index_helper work only with bash. Using ZSH, trying to complete an inexistant directory gave this: git add no-such-dir/__git_ls_files_helper:cd:2: no such file or directory: no-such-dir/ Signed-off-by: Matthieu Moy

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Junio C Hamano
Matthieu Moy matthieu@imag.fr writes: The function-wide redirection used for __git_ls_files_helper and __git_diff_index_helper work only with bash. Using ZSH, trying to complete an inexistant directory gave this: git add no-such-dir/__git_ls_files_helper:cd:2: no such file or

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: After all, I was right when I said that some implementations may get it wrong and we shouldn't use the construct X-. These two instances seem to be the only ones in the file. I'm not sure whether the 2/dev/null would be needed for the command on the

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: So here is an updated based on your patch. Perfect, thanks. The correct thing to do in the longer term may be to stop dot-sourcing the source meant for bash into zsh, but this patch should suffice as a band-aid in the meantime. I disagree with this

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Junio C Hamano gits...@pobox.com writes: So here is an updated based on your patch. Perfect, thanks. The correct thing to do in the longer term may be to stop dot-sourcing the source meant for bash into zsh, but this patch should suffice

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 11/03/2013 17:17, Junio C Hamano ha scritto: Matthieu Moy matthieu@imag.fr writes: The function-wide redirection used for __git_ls_files_helper and __git_diff_index_helper work only with bash. Using ZSH, trying to complete an inexistant

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 11/03/2013 18:01, Junio C Hamano ha scritto: [...] Having to restrict to the common subset means that whenever bash adds new and useful features that this script could take advantage of to improve the user experience, they cannot be employed

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Junio C Hamano
Manlio Perillo manlio.peri...@gmail.com writes: Yes, I was plainning to send another patch to fix this (and your other suggestion regarding the CDPATH environment variable, if I remember correctly),... Ahh, thanks for reminding me of this. You are right; these two functions are broken when

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: Ahh, thanks for reminding me of this. You are right; these two functions are broken when the user has CDPATH set, I think. Here is a reroll. Thanks. Even nicer that the previous since the CDPATH implied the subshell anyway. -- Matthieu Moy

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Junio C Hamano gits...@pobox.com writes: Ahh, thanks for reminding me of this. You are right; these two functions are broken when the user has CDPATH set, I think. Here is a reroll. Thanks. Even nicer that the previous since the CDPATH

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Paul Smith
On Mon, 2013-03-11 at 11:09 -0700, Junio C Hamano wrote: So strictly speaking there is no reason for an extra subshell here, but writing this in the way the patch does makes our intention crystal clear, I think. If you're concerned about the extra processing of the new shell you can use {}

Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility

2013-03-11 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 11/03/2013 19:09, Junio C Hamano ha scritto: Matthieu Moy matthieu@grenoble-inp.fr writes: Junio C Hamano gits...@pobox.com writes: Ahh, thanks for reminding me of this. You are right; these two functions are broken when the user has