2011-08-18 11:23:46 +04:00
|
|
|
diff_cmd () {
|
|
|
|
"$merge_tool_path" "$LOCAL" "$REMOTE"
|
|
|
|
}
|
|
|
|
|
|
|
|
merge_cmd () {
|
2011-08-19 13:14:45 +04:00
|
|
|
if test -z "${meld_has_output_option:+set}"
|
|
|
|
then
|
|
|
|
check_meld_for_output_version
|
|
|
|
fi
|
2016-11-29 12:38:07 +03:00
|
|
|
|
2011-08-19 13:14:45 +04:00
|
|
|
if test "$meld_has_output_option" = true
|
|
|
|
then
|
2017-06-19 05:10:33 +03:00
|
|
|
"$merge_tool_path" --output="$MERGED" \
|
2011-08-19 13:14:45 +04:00
|
|
|
"$LOCAL" "$BASE" "$REMOTE"
|
|
|
|
else
|
|
|
|
"$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE"
|
|
|
|
fi
|
2011-08-18 11:23:46 +04:00
|
|
|
}
|
2011-08-19 13:14:45 +04:00
|
|
|
|
2014-10-16 08:45:14 +04:00
|
|
|
# Check whether we should use 'meld --output <file>'
|
2011-08-19 13:14:45 +04:00
|
|
|
check_meld_for_output_version () {
|
|
|
|
meld_path="$(git config mergetool.meld.path)"
|
|
|
|
meld_path="${meld_path:-meld}"
|
|
|
|
|
2014-10-16 08:45:14 +04:00
|
|
|
if meld_has_output_option=$(git config --bool mergetool.meld.hasOutput)
|
2011-08-19 13:14:45 +04:00
|
|
|
then
|
2014-10-16 08:45:14 +04:00
|
|
|
: use configured value
|
|
|
|
elif "$meld_path" --help 2>&1 |
|
|
|
|
grep -e '--output=' -e '\[OPTION\.\.\.\]' >/dev/null
|
|
|
|
then
|
|
|
|
: old ones mention --output and new ones just say OPTION...
|
2011-08-19 13:14:45 +04:00
|
|
|
meld_has_output_option=true
|
|
|
|
else
|
|
|
|
meld_has_output_option=false
|
|
|
|
fi
|
|
|
|
}
|