From: Jacob Nisnevich Date: Wed, 23 Mar 2016 00:43:13 GMT Subject: [PATCH 1/2] mergetools: created new mergetool file for ExamDiff Message-ID: <1458693794-9124-2-git-send-email-jacob.nisnevich@gmail.com> In-Reply-To: <1458693794-9124-1-git-send-email-jacob.nisnevich@gmail.com> Signed-off-by: Jacob Nisnevich --- mergetools/examdiff | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 mergetools/examdiff diff --git a/mergetools/examdiff b/mergetools/examdiff new file mode 100644 index 0000000..474fffe --- /dev/null +++ b/mergetools/examdiff @@ -0,0 +1,37 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" -nh +} + +merge_cmd () { + touch "$BACKUP" + if $base_present + then + "$merge_tool_path" -merge "$LOCAL" "$BASE" "$REMOTE" -o:"$MERGED" -nh + else + "$merge_tool_path" -merge "$LOCAL" "$REMOTE" -o:"$MERGED" -nh + fi + check_unchanged +} + +translate_merge_tool_path() { + # Use ExamDiff.com if it exists in $PATH + if type -p ExamDiff.com >/dev/null 2>&1 + then + printf ExamDiff.com + return + fi + + # Look for ExamDiff.com in the typical locations + examdiff="ExamDiff Pro/ExamDiff.com" + for directory in $(env | grep -Ei '^PROGRAM(FILES(\(X86\))?|W6432)=' | + cut -d '=' -f 2- | sort -u) + do + if test -n "$directory" && test -x "$directory/$examdiff" + then + printf '%s' "$directory/$examdiff" + return + fi + done + + printf ExamDiff.com +} \ No newline at end of file -- 1.9.1