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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 {} instead of ():

        {
            test -n "${CDPATH+set}" && unset CDPATH
            # NOTE: $2 is not quoted in order to support multiple options
            cd "$1" && git ls-files --exclude-standard $2
        } 2>/dev/null

Zsh does support this properly in my testing.  It's only redirection of
an entire function body, as the original, that is working differently in
zsh and bash.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]