sorin-ionescu / prezto

The configuration framework for Zsh
MIT License
13.99k stars 4.49k forks source link

diff behaves improperly on OS X.8 #332

Closed ahmadia closed 11 years ago

ahmadia commented 11 years ago

For some reason I can't quite decipher, diff is falling back to git diff on my prompt:

~/s/r/ketch ❯❯❯ diff                                                                                                                 ⏎
usage: git diff --no-index <path> <path>
~/s/r/ketch ❯❯❯ which diff
diff () {
    if zstyle -t ':prezto:module:utility:diff' color
    then
        if (( $+commands[colordiff] ))
        then
            command diff --unified "$@" | colordiff --difftype diffu
        elif (( $+commands[git] ))
        then
            git --no-pager diff --color=auto --no-ext-diff --no-index "$@"
        else
            command diff --unified "$@"
        fi
    else
        command diff --unified "$@"
    fi
}

Any help understanding what to check?

swsnr commented 11 years ago

The check tries hard to enable diff coloring. git diff does colored diffs, and works fine outside git repositories.

If you do not like this, either install colordiff or disable diff coloring by the corresponding zstyle.

ahmadia commented 11 years ago

odd, git diff seems to break for me when I try to diff two directories (1.7.10.2)

A

On Sun, Dec 2, 2012 at 1:29 PM, Sebastian Wiesner notifications@github.comwrote:

The check tries hard to enable diff coloring. git diff does colored diffs, and works fine outside git repositories.

If you do not like this, either install colordiff or disable diff coloring by the corresponding zstyle.

— Reply to this email directly or view it on GitHubhttps://github.com/sorin-ionescu/prezto/issues/332#issuecomment-10928125.

sorin-ionescu commented 11 years ago

@ahmadia Git does not support diffing directories. You can set zstyle ':prezto:module:utility:diff' color 'no' in zpreztorc to turn off that function.