If anyone is wondering how to get "git diff" working from the git bash, here's what I came up with:
Configure a different diff method for *.vi and *.ctl To do that, we add the following to .gitattributes (or .git/info/attributes or your global gitattributes file) *.vi diff=lvdiff *.ctl diff=lvdiff
Define what git should do for those files $ git config --global diff.lvdiff.command 'lvcomparewrapper.sh "$LOCAL" "$REMOTE"'
Put lvcomparewrapper.sh somwhere in the $PATH ($ echo $PATH) (or modify above command to an absolute call) I had to slightly modify the wrapper script to this: #!/bin/bash# Method to determine absolute path# The -W parameter on the pwd command is necessary to return the Windows version of the path.# Not using the -W parameter will result in a conversion of temp directory to a 'tmp' path meaningful only in the Linux # environment.# Piping the result through tr '/' '' translates the forward slashes to backslashes.# Windows understands forward slashes, but LVCompare.exe does not.abspath () { ( DIR=$(dirname "$1") FN=$(basename "$1") cd "$DIR" printf "%s/%s" "$(pwd -W)" "$FN" | tr '/' '' )}lvcompare="C:Program Files (x86)National InstrumentsSharedLabVIEW CompareLVCompare.exe"local=$(abspath "$4")remote=$(abspath "$3")echo Launching "$lvcompare"#echo Launching "$lvcompare" -nobdpos -nofppos "$local" "$remote"exec "$lvcompare" -nobdpos -nofppos "$local" "$remote"
Now you're all set up to use the good old command line:
$ git diff Main.viLaunching C:Program Files (x86)National InstrumentsSharedLabVIEW CompareLVCompare.exe