Knowledge Base
Authentication is disabled (development mode).

git diff using bcompare

Edit

diff git

git config --global diff.tool git-bcompare
git config --global diff.tool.git-bcompare.cmd 'git-bcompare "$LOCAL" "$REMOTE"'
git config --global diff.prompt false
cat <<"EOF" > /usr/local/bin/git-bcompare
#!/bin/bash

# diff is called by git with 7 parameters:
# path old-file old-hex old-mode new-file new-hex new-mode

if [ "$5" = /dev/null ]; then
	tmp=$(mktemp) && trap "rm -f "$tmp"" EXIT
	echo "*** $1 has been deleted ***" > $tmp
	/usr/bin/bcompare "$2" "$tmp"
else
	/usr/bin/bcompare "$2" "$5" # --lefttitle="$1 ($3)" --righttitle="$1 ($6)"
fi

result=$?

case $result in
0)	;& # Success
1)	;& # Binary same
2)	;& # Rules-based same
11)	;& # Binary differences
12)	;& # Similar
13)	   # Rules-based differences
	echo true
	;;
14)	;& #Conflicts detected
100)	;& # Unknown error
101)	;& # Conflicts detected, merge output not written
102)	;& # BComp.exe unable to wait until BCompare.exe finishes
103)	;& # BComp.exe cannot find BCompare.exe
104)	;& # Trial period expired
105)	;& # Error loading script file
106)	;& # Script syntax error
107)	   # Script failed to load folders or files
	exit $result
	;;
esac
EOF