diff --git a/README.md b/README.md index 2782ade..f132efb 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ It will tell you what it's done, so it should look something like this: + echo '*.jpeg diff=image' >>'/Users/yourname/.gitattributes' + echo '*.jpg diff=image' >>'/Users/yourname/.gitattributes' + echo '*.png diff=image' >>'/Users/yourname/.gitattributes' -+ git config --global alias.diff-image '!f() { GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f' ++ git config --global alias.diff-image '!f() { cd -- "${GIT_PREFIX:-.}"; GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f' + git config --global diff.image.command '~/git-diff-image/git_diff_image' ``` diff --git a/install.sh b/install.sh index a9bd69d..3fb7f03 100755 --- a/install.sh +++ b/install.sh @@ -69,8 +69,8 @@ addattr jpeg addattr jpg addattr png -echo '+ git config --global alias.diff-image '"'"'!f() { GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f'"'" -git config --global alias.diff-image '!f() { GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f' +echo '+ git config --global alias.diff-image '"'"'!f() { cd -- "${GIT_PREFIX:-.}"; GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f'"'" +git config --global alias.diff-image '!f() { cd -- "${GIT_PREFIX:-.}"; GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f' echo "+ git config --global diff.image.command '$thisdir_tilde/git_diff_image'" git config --global diff.image.command "$thisdir_tilde/git_diff_image"