git config: support bcdiff/bcmerge from linux as well

This commit is contained in:
Josh Holtrop 2016-08-16 14:45:21 -04:00
parent e86ec078fb
commit 4bce7a84b6
3 changed files with 29 additions and 18 deletions

View File

@ -182,7 +182,6 @@ function git-config-joshs()
git config --global alias.mktarxz '!function f { name="$1"; pos="$2"; if [ "$pos" == "" ]; then pos=HEAD; fi; git archive --prefix="$name"/ "$pos" | xz > ../"$name".tar.xz; }; f' git config --global alias.mktarxz '!function f { name="$1"; pos="$2"; if [ "$pos" == "" ]; then pos=HEAD; fi; git archive --prefix="$name"/ "$pos" | xz > ../"$name".tar.xz; }; f'
git config --global alias.amd 'am --committer-date-is-author-date' git config --global alias.amd 'am --committer-date-is-author-date'
git config --global push.default upstream git config --global push.default upstream
if [ -e /bin/cygwin1.dll ]; then
git config --global alias.bcdiff 'difftool -y -t bc3' git config --global alias.bcdiff 'difftool -y -t bc3'
git config --global alias.bcdiffc 'difftool -y -t bc3 --cached' git config --global alias.bcdiffc 'difftool -y -t bc3 --cached'
git config --global difftool.bc3.cmd 'git_bc3diff "$LOCAL" "$REMOTE"' git config --global difftool.bc3.cmd 'git_bc3diff "$LOCAL" "$REMOTE"'
@ -190,7 +189,6 @@ function git-config-joshs()
git config --global mergetool.bc3.cmd \ git config --global mergetool.bc3.cmd \
'git_bc3merge "$LOCAL" "$REMOTE" "$MERGED"' 'git_bc3merge "$LOCAL" "$REMOTE" "$MERGED"'
git config --global mergetool.bc3.trustExitCode false git config --global mergetool.bc3.trustExitCode false
fi
} }
function git-config-local-personal() function git-config-local-personal()
{ {

View File

@ -1,5 +1,14 @@
#!/bin/sh #!/bin/bash
path1=$(cygpath -w "$1") if [[ $(uname) =~ CYGWIN ]]; then
path2=$(cygpath -w "$2") path1=$(cygpath -w "$1")
'/cygdrive/c/Program Files (x86)/Beyond Compare 3/BComp.exe' "$path1" "$path2" /title1=Base /leftreadonly path2=$(cygpath -w "$2")
'/cygdrive/c/apps/Beyond Compare 3/BCompare.exe' "$path1" "$path2" /title1=Base /leftreadonly &
else
bcompare "$1" "$2" -title1=Base -leftreadonly &
fi
# git will remove the temporary file as soon as the difftool command exits;
# sleep to give Beyond Compare a chance to load the file and display the diff
# before the file is removed.
sleep 1

View File

@ -1,6 +1,10 @@
#!/bin/sh #!/bin/bash
local=$(cygpath -w "$1") if [[ $(uname) =~ CYGWIN ]]; then
remote=$(cygpath -w "$2") local=$(cygpath -w "$1")
merged=$(cygpath -w "$3") remote=$(cygpath -w "$2")
'/cygdrive/c/Program Files (x86)/Beyond Compare 3/BComp.exe' "$local" "$remote" /title1=Local /title2=Remote /savetarget="$merged" merged=$(cygpath -w "$3")
'/cygdrive/c/apps/Beyond Compare 3/BCompare.exe' "$local" "$remote" /title1=Local /title2=Remote /savetarget="$merged"
else
bcompare "$1" "$2" -title1=Local -title2=Remote -savetarget="$3"
fi