{"thread":{"id":"41758","subject":"[PATCH] mergetools: created new mergetool file for ExamDiff","startedAt":"2016-03-20T04:58:52Z","lastAt":"2016-04-02T21:02:39Z","messageCount":20,"participants":["Jacob Nisnevich","Junio C Hamano","David Aguilar"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"281257","messageId":"1458449932-24342-1-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":null,"subject":"[PATCH] mergetools: created new mergetool file for ExamDiff","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-20T04:58:52Z","receivedAt":"2016-03-20T04:58:52Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"---\n mergetools/examdiff | 37 +++++++++++++++++++++++++++++++++++++\n 1 file changed, 37 insertions(+)\n create mode 100644 mergetools/examdiff\n\ndiff --git a/mergetools/examdiff b/mergetools/examdiff\nnew file mode 100644\nindex 0000000..474fffe\n--- /dev/null\n+++ b/mergetools/examdiff\n@@ -0,0 +1,37 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n+}\n+\n+merge_cmd () {\n+\ttouch \"$BACKUP\"\n+\tif $base_present\n+\tthen\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\telse\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\tfi\n+\tcheck_unchanged\n+}\n+\n+translate_merge_tool_path() {\n+\t# Use ExamDiff.com if it exists in $PATH\n+\tif type -p ExamDiff.com >/dev/null 2>&1\n+\tthen\n+\t\tprintf ExamDiff.com\n+\t\treturn\n+\tfi\n+\n+\t# Look for ExamDiff.com in the typical locations\n+\texamdiff=\"ExamDiff Pro/ExamDiff.com\"\n+\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n+\t\tcut -d '=' -f 2- | sort -u)\n+\tdo\n+\t\tif test -n \"$directory\" && test -x \"$directory/$examdiff\"\n+\t\tthen\n+\t\t\tprintf '%s' \"$directory/$examdiff\"\n+\t\t\treturn\n+\t\tfi\n+\tdone\n+\n+\tprintf ExamDiff.com\n+}\n\\ No newline at end of file\n-- \n1.9.1\n"},{"id":"281316","messageId":"xmqqfuvkod6o.fsf@gitster.mtv.corp.google.com","threadId":"41758","inReplyTo":"1458449932-24342-1-git-send-email-jacob.nisnevich@gmail.com","subject":"Re: [PATCH] mergetools: created new mergetool file for ExamDiff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-21T01:02:55Z","receivedAt":"2016-03-21T01:02:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Nisnevich <jacob.nisnevich@gmail.com> writes:\n\n> ---\n\nMissing sign-off.\n\nI'll Cc the area expert (David Aguilar).\n\n>  mergetools/examdiff | 37 +++++++++++++++++++++++++++++++++++++\n>  1 file changed, 37 insertions(+)\n>  create mode 100644 mergetools/examdiff\n>\n> diff --git a/mergetools/examdiff b/mergetools/examdiff\n> new file mode 100644\n> index 0000000..474fffe\n> --- /dev/null\n> +++ b/mergetools/examdiff\n> @@ -0,0 +1,37 @@\n> +diff_cmd () {\n> +\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n> +}\n> +\n> +merge_cmd () {\n> +\ttouch \"$BACKUP\"\n> +\tif $base_present\n> +\tthen\n> +\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n> +\telse\n> +\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n> +\tfi\n> +\tcheck_unchanged\n> +}\n> +\n> +translate_merge_tool_path() {\n> +\t# Use ExamDiff.com if it exists in $PATH\n> +\tif type -p ExamDiff.com >/dev/null 2>&1\n> +\tthen\n> +\t\tprintf ExamDiff.com\n> +\t\treturn\n> +\tfi\n> +\n> +\t# Look for ExamDiff.com in the typical locations\n> +\texamdiff=\"ExamDiff Pro/ExamDiff.com\"\n> +\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n> +\t\tcut -d '=' -f 2- | sort -u)\n> +\tdo\n> +\t\tif test -n \"$directory\" && test -x \"$directory/$examdiff\"\n> +\t\tthen\n> +\t\t\tprintf '%s' \"$directory/$examdiff\"\n> +\t\t\treturn\n> +\t\tfi\n> +\tdone\n> +\n> +\tprintf ExamDiff.com\n\nThis complicated heuristics look like a cut-and-paste from the\nneighbouring winmerge; makes me suspect that they should share the\nsame helper function to implement the bulk of the above code for\nbetter maintainability (e.g. imagine in the future Microsoft decides\nto introduce another directory organization and makes it necessary\nto tweak the pattern you give to 'grep -Ei'---WinMergeU user may\nnotice that and fix it, while this script will be overlooked and\nwill stay stale until somebody from examdiff camp do the same fix\nlater).\n\n\n> +}\n> \\ No newline at end of file\n\nNo newline at end of file?\n"},{"id":"281318","messageId":"20160321033201.GA2004@gmail.com","threadId":"41758","inReplyTo":"xmqqfuvkod6o.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] mergetools: created new mergetool file for ExamDiff","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-03-21T03:32:01Z","receivedAt":"2016-03-21T03:32:01Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Sun, Mar 20, 2016 at 06:02:55PM -0700, Junio C Hamano wrote:\n> Jacob Nisnevich <jacob.nisnevich@gmail.com> writes:\n> \n> > ---\n> \n> Missing sign-off.\n> \n> I'll Cc the area expert (David Aguilar).\n> \n> >  mergetools/examdiff | 37 +++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 37 insertions(+)\n> >  create mode 100644 mergetools/examdiff\n> >\n> > diff --git a/mergetools/examdiff b/mergetools/examdiff\n> > new file mode 100644\n> > index 0000000..474fffe\n> > --- /dev/null\n> > +++ b/mergetools/examdiff\n> > @@ -0,0 +1,37 @@\n> > +diff_cmd () {\n> > +\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n> > +}\n> > +\n> > +merge_cmd () {\n> > +\ttouch \"$BACKUP\"\n> > +\tif $base_present\n> > +\tthen\n> > +\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n> > +\telse\n> > +\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n> > +\tfi\n> > +\tcheck_unchanged\n> > +}\n> > +\n> > +translate_merge_tool_path() {\n> > +\t# Use ExamDiff.com if it exists in $PATH\n> > +\tif type -p ExamDiff.com >/dev/null 2>&1\n> > +\tthen\n> > +\t\tprintf ExamDiff.com\n> > +\t\treturn\n> > +\tfi\n> > +\n> > +\t# Look for ExamDiff.com in the typical locations\n> > +\texamdiff=\"ExamDiff Pro/ExamDiff.com\"\n> > +\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n> > +\t\tcut -d '=' -f 2- | sort -u)\n> > +\tdo\n> > +\t\tif test -n \"$directory\" && test -x \"$directory/$examdiff\"\n> > +\t\tthen\n> > +\t\t\tprintf '%s' \"$directory/$examdiff\"\n> > +\t\t\treturn\n> > +\t\tfi\n> > +\tdone\n> > +\n> > +\tprintf ExamDiff.com\n> \n> This complicated heuristics look like a cut-and-paste from the\n> neighbouring winmerge; makes me suspect that they should share the\n> same helper function to implement the bulk of the above code for\n> better maintainability (e.g. imagine in the future Microsoft decides\n> to introduce another directory organization and makes it necessary\n> to tweak the pattern you give to 'grep -Ei'---WinMergeU user may\n> notice that and fix it, while this script will be overlooked and\n> will stay stale until somebody from examdiff camp do the same fix\n> later).\n\nI agree with that.\n\nSomething like mergetool_find_win32_cmd() might make sense as a\nhelper function that we can reuse here.\n\n> > +}\n> > \\ No newline at end of file\n> \n> No newline at end of file?\n\nUsing sublime text perhaps?\nIt defaults to not including the final line newline terminator.\n\nhttps://forum.sublimetext.com/t/make-saving-newline-at-eof-the-installation-default/9842\n\nIf so, please configure it as detailed in the above thread.\n\ncheers,\n-- \nDavid\n"},{"id":"281515","messageId":"1458693794-9124-1-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"20160321033201.GA2004@gmail.com","subject":"[PATCH 0/2] Helper function for ExamDiff and Winmerge mergetools","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-23T00:43:12Z","receivedAt":"2016-03-23T00:43:12Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"I've been trying to implement a helper function for both Winmerge and ExamDiff\nas you requested, but for some reason including another shell script with . or\nsource seems to fail on Windows in this case. I've attached the patches for the\ntwo commits I've made so far. Is there anything I'm doing wrong or is it an\nissue with Windows?\n\nJacob Nisnevich (2):\n  mergetools: created new mergetool file for ExamDiff\n  created helper function for both winmerge and examdiff mergetools\n\n ...s-created-new-mergetool-file-for-ExamDiff.patch | 58 ++++++++++++++++++++++\n mergetools/examdiff                                | 20 ++++++++\n mergetools/mergetools_helpers                      | 30 +++++++++++\n mergetools/winmerge                                | 23 ++-------\n 4 files changed, 111 insertions(+), 20 deletions(-)\n create mode 100644 0001-mergetools-created-new-mergetool-file-for-ExamDiff.patch\n create mode 100644 mergetools/examdiff\n create mode 100644 mergetools/mergetools_helpers\n\n-- \n1.9.1\n"},{"id":"281514","messageId":"1458693794-9124-2-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"1458693794-9124-1-git-send-email-jacob.nisnevich@gmail.com","subject":"[PATCH 1/2] mergetools: created new mergetool file for ExamDiff","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-23T00:43:13Z","receivedAt":"2016-03-23T00:43:13Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n---\n mergetools/examdiff | 37 +++++++++++++++++++++++++++++++++++++\n 1 file changed, 37 insertions(+)\n create mode 100644 mergetools/examdiff\n\ndiff --git a/mergetools/examdiff b/mergetools/examdiff\nnew file mode 100644\nindex 0000000..474fffe\n--- /dev/null\n+++ b/mergetools/examdiff\n@@ -0,0 +1,37 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n+}\n+\n+merge_cmd () {\n+\ttouch \"$BACKUP\"\n+\tif $base_present\n+\tthen\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\telse\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\tfi\n+\tcheck_unchanged\n+}\n+\n+translate_merge_tool_path() {\n+\t# Use ExamDiff.com if it exists in $PATH\n+\tif type -p ExamDiff.com >/dev/null 2>&1\n+\tthen\n+\t\tprintf ExamDiff.com\n+\t\treturn\n+\tfi\n+\n+\t# Look for ExamDiff.com in the typical locations\n+\texamdiff=\"ExamDiff Pro/ExamDiff.com\"\n+\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n+\t\tcut -d '=' -f 2- | sort -u)\n+\tdo\n+\t\tif test -n \"$directory\" && test -x \"$directory/$examdiff\"\n+\t\tthen\n+\t\t\tprintf '%s' \"$directory/$examdiff\"\n+\t\t\treturn\n+\t\tfi\n+\tdone\n+\n+\tprintf ExamDiff.com\n+}\n\\ No newline at end of file\n-- \n1.9.1\n"},{"id":"281516","messageId":"1458693794-9124-3-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"1458693794-9124-1-git-send-email-jacob.nisnevich@gmail.com","subject":"[PATCH 2/2] created helper function for both winmerge and examdiff mergetools","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-23T00:43:14Z","receivedAt":"2016-03-23T00:43:14Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n---\n ...s-created-new-mergetool-file-for-ExamDiff.patch | 58 ++++++++++++++++++++++\n mergetools/examdiff                                | 25 ++--------\n mergetools/mergetools_helpers                      | 30 +++++++++++\n mergetools/winmerge                                | 23 ++-------\n 4 files changed, 95 insertions(+), 41 deletions(-)\n create mode 100644 0001-mergetools-created-new-mergetool-file-for-ExamDiff.patch\n create mode 100644 mergetools/mergetools_helpers\n\ndiff --git a/0001-mergetools-created-new-mergetool-file-for-ExamDiff.patch b/0001-mergetools-created-new-mergetool-file-for-ExamDiff.patch\nnew file mode 100644\nindex 0000000..99e0d6b\n--- /dev/null\n+++ b/0001-mergetools-created-new-mergetool-file-for-ExamDiff.patch\n@@ -0,0 +1,58 @@\n+From a26ad589bc5e747962359c89c5536858748e5eb8 Mon Sep 17 00:00:00 2001\n+From: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n+Date: Sat, 19 Mar 2016 17:31:50 -0700\n+Subject: [PATCH] mergetools: created new mergetool file for ExamDiff\n+To: git@vger.kernel.org\n+\n+---\n+ mergetools/examdiff | 37 +++++++++++++++++++++++++++++++++++++\n+ 1 file changed, 37 insertions(+)\n+ create mode 100644 mergetools/examdiff\n+\n+diff --git a/mergetools/examdiff b/mergetools/examdiff\n+new file mode 100644\n+index 0000000..474fffe\n+--- /dev/null\n++++ b/mergetools/examdiff\n+@@ -0,0 +1,37 @@\n++diff_cmd () {\n++\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n++}\n++\n++merge_cmd () {\n++\ttouch \"$BACKUP\"\n++\tif $base_present\n++\tthen\n++\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n++\telse\n++\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n++\tfi\n++\tcheck_unchanged\n++}\n++\n++translate_merge_tool_path() {\n++\t# Use ExamDiff.com if it exists in $PATH\n++\tif type -p ExamDiff.com >/dev/null 2>&1\n++\tthen\n++\t\tprintf ExamDiff.com\n++\t\treturn\n++\tfi\n++\n++\t# Look for ExamDiff.com in the typical locations\n++\texamdiff=\"ExamDiff Pro/ExamDiff.com\"\n++\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n++\t\tcut -d '=' -f 2- | sort -u)\n++\tdo\n++\t\tif test -n \"$directory\" && test -x \"$directory/$examdiff\"\n++\t\tthen\n++\t\t\tprintf '%s' \"$directory/$examdiff\"\n++\t\t\treturn\n++\t\tfi\n++\tdone\n++\n++\tprintf ExamDiff.com\n++}\n+\\ No newline at end of file\n+-- \n+1.9.1\n+\ndiff --git a/mergetools/examdiff b/mergetools/examdiff\nindex 474fffe..8b66c17 100644\n--- a/mergetools/examdiff\n+++ b/mergetools/examdiff\n@@ -1,3 +1,5 @@\n+. mergetools_helpers\n+\n diff_cmd () {\n \t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n }\n@@ -14,24 +16,5 @@ merge_cmd () {\n }\n \n translate_merge_tool_path() {\n-\t# Use ExamDiff.com if it exists in $PATH\n-\tif type -p ExamDiff.com >/dev/null 2>&1\n-\tthen\n-\t\tprintf ExamDiff.com\n-\t\treturn\n-\tfi\n-\n-\t# Look for ExamDiff.com in the typical locations\n-\texamdiff=\"ExamDiff Pro/ExamDiff.com\"\n-\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n-\t\tcut -d '=' -f 2- | sort -u)\n-\tdo\n-\t\tif test -n \"$directory\" && test -x \"$directory/$examdiff\"\n-\t\tthen\n-\t\t\tprintf '%s' \"$directory/$examdiff\"\n-\t\t\treturn\n-\t\tfi\n-\tdone\n-\n-\tprintf ExamDiff.com\n-}\n\\ No newline at end of file\n+\tmergetool_find_win32_cmd \"ExamDiff.com\" \"ExamDiff Pro\"\n+}\ndiff --git a/mergetools/mergetools_helpers b/mergetools/mergetools_helpers\nnew file mode 100644\nindex 0000000..6df9d09\n--- /dev/null\n+++ b/mergetools/mergetools_helpers\n@@ -0,0 +1,30 @@\n+# Find path to win32 executable using typical locations\n+# Arguments\n+#  executable      - default name of executable file\n+#  folder          - folder containing executable file from Program Files\n+# Returns\n+#  Path to the executable\n+mergetool_find_win32_cmd () {\n+\texecutable = $1\n+\tfolder = $2\n+\n+\t# Use executable.com if it exists in $PATH\n+\tif type -p $executable >/dev/null 2>&1\n+\tthen\n+\t\tprintf $executable\n+\t\treturn\n+\tfi\n+\n+\t# Look for executable in the typical locations\n+\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n+\t\tcut -d '=' -f 2- | sort -u)\n+\tdo\n+\t\tif test -n \"$directory\" && test -x \"$directory/$folder/$executable\"\n+\t\tthen\n+\t\t\tprintf '%s' \"$directory/$folder/$executable\"\n+\t\t\treturn\n+\t\tfi\n+\tdone\n+\n+\tprintf $executable\n+}\ndiff --git a/mergetools/winmerge b/mergetools/winmerge\nindex 74a66d4..265d853 100644\n--- a/mergetools/winmerge\n+++ b/mergetools/winmerge\n@@ -1,3 +1,5 @@\n+. mergetools_helpers\n+\n diff_cmd () {\n \t\"$merge_tool_path\" -u -e \"$LOCAL\" \"$REMOTE\"\n \treturn 0\n@@ -13,24 +15,5 @@ merge_cmd () {\n }\n \n translate_merge_tool_path() {\n-\t# Use WinMergeU.exe if it exists in $PATH\n-\tif type -p WinMergeU.exe >/dev/null 2>&1\n-\tthen\n-\t\tprintf WinMergeU.exe\n-\t\treturn\n-\tfi\n-\n-\t# Look for WinMergeU.exe in the typical locations\n-\twinmerge_exe=\"WinMerge/WinMergeU.exe\"\n-\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n-\t\tcut -d '=' -f 2- | sort -u)\n-\tdo\n-\t\tif test -n \"$directory\" && test -x \"$directory/$winmerge_exe\"\n-\t\tthen\n-\t\t\tprintf '%s' \"$directory/$winmerge_exe\"\n-\t\t\treturn\n-\t\tfi\n-\tdone\n-\n-\tprintf WinMergeU.exe\n+\tmergetool_find_win32_cmd \"WinMergeU.exe\" \"WinMerge\"\n }\n-- \n1.9.1\n"},{"id":"281517","messageId":"xmqqpoulex0b.fsf@gitster.mtv.corp.google.com","threadId":"41758","inReplyTo":"1458693794-9124-3-git-send-email-jacob.nisnevich@gmail.com","subject":"Re: [PATCH 2/2] created helper function for both winmerge and examdiff mergetools","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-23T02:41:40Z","receivedAt":"2016-03-23T02:41:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Nisnevich <jacob.nisnevich@gmail.com> writes:\n\n> diff --git a/mergetools/examdiff b/mergetools/examdiff\n> index 474fffe..8b66c17 100644\n> --- a/mergetools/examdiff\n> +++ b/mergetools/examdiff\n> @@ -1,3 +1,5 @@\n> +. mergetools_helpers\n> +\n\nThe way dot-inclusion is done in existing mergetools/* files may\ngive you a hint, perhaps?\n\n$ git grep '^\\. ' mergetools\nmergetools/bc3:. \"$MERGE_TOOLS_DIR/bc\"\nmergetools/gvimdiff:. \"$MERGE_TOOLS_DIR/vimdiff\"\nmergetools/gvimdiff2:. \"$MERGE_TOOLS_DIR/vimdiff\"\nmergetools/gvimdiff3:. \"$MERGE_TOOLS_DIR/vimdiff\"\nmergetools/vimdiff2:. \"$MERGE_TOOLS_DIR/vimdiff\"\nmergetools/vimdiff3:. \"$MERGE_TOOLS_DIR/vimdiff\"\n"},{"id":"281615","messageId":"1458773745-783-1-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"xmqqpoulex0b.fsf@gitster.mtv.corp.google.com","subject":"[PATCH] mergetools: implemented new mergetool file for ExamDiff","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-23T22:55:44Z","receivedAt":"2016-03-23T22:55:44Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"Thanks for the hint. I used the other examples to fix the implementation of the \nExamDiff mergetool. I've tested the Winmerge and ExamDiff mergetools with both\n`git difftool` and `git mergetool` and both seem to work as expected. I've \ncombined all my changes into one patch. Are there any other issues with my\nchanges?\n\nJacob Nisnevich (1):\n  mergetools: implemented new mergetool file for ExamDiff\n\n mergetools/examdiff           | 20 ++++++++++++++++++++\n mergetools/mergetools_helpers | 24 ++++++++++++++++++++++++\n mergetools/winmerge           | 23 +++--------------------\n 3 files changed, 47 insertions(+), 20 deletions(-)\n create mode 100644 mergetools/examdiff\n create mode 100644 mergetools/mergetools_helpers\n\n-- \n1.9.1\n"},{"id":"281614","messageId":"1458773745-783-2-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"1458773745-783-1-git-send-email-jacob.nisnevich@gmail.com","subject":"[PATCH] mergetools: implemented new mergetool file for ExamDiff","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-23T22:55:45Z","receivedAt":"2016-03-23T22:55:45Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n---\n mergetools/examdiff           | 20 ++++++++++++++++++++\n mergetools/mergetools_helpers | 24 ++++++++++++++++++++++++\n mergetools/winmerge           | 23 +++--------------------\n 3 files changed, 47 insertions(+), 20 deletions(-)\n create mode 100644 mergetools/examdiff\n create mode 100644 mergetools/mergetools_helpers\n\ndiff --git a/mergetools/examdiff b/mergetools/examdiff\nnew file mode 100644\nindex 0000000..c5edd0e\n--- /dev/null\n+++ b/mergetools/examdiff\n@@ -0,0 +1,20 @@\n+. \"$MERGE_TOOLS_DIR/mergetools_helpers\"\n+\n+diff_cmd () {\n+\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n+}\n+\n+merge_cmd () {\n+\ttouch \"$BACKUP\"\n+\tif $base_present\n+\tthen\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\telse\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\tfi\n+\tcheck_unchanged\n+}\n+\n+translate_merge_tool_path() {\n+\tmergetool_find_win32_cmd \"ExamDiff.com\" \"ExamDiff Pro\"\n+}\ndiff --git a/mergetools/mergetools_helpers b/mergetools/mergetools_helpers\nnew file mode 100644\nindex 0000000..46ae2d8\n--- /dev/null\n+++ b/mergetools/mergetools_helpers\n@@ -0,0 +1,24 @@\n+mergetool_find_win32_cmd () {\n+\texecutable=$1\n+\tfolder=$2\n+\n+\t# Use executable.com if it exists in $PATH\n+\tif type -p $executable >/dev/null 2>&1\n+\tthen\n+\t\tprintf $executable\n+\t\treturn\n+\tfi\n+\n+\t# Look for executable in the typical locations\n+\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n+\t\tcut -d '=' -f 2- | sort -u)\n+\tdo\n+\t\tif test -n \"$directory\" && test -x \"$directory/$folder/$executable\"\n+\t\tthen\n+\t\t\tprintf '%s' \"$directory/$folder/$executable\"\n+\t\t\treturn\n+\t\tfi\n+\tdone\n+\n+\tprintf $executable\n+}\ndiff --git a/mergetools/winmerge b/mergetools/winmerge\nindex 74a66d4..c785be8 100644\n--- a/mergetools/winmerge\n+++ b/mergetools/winmerge\n@@ -1,3 +1,5 @@\n+. \"$MERGE_TOOLS_DIR/mergetools_helpers\"\n+\n diff_cmd () {\n \t\"$merge_tool_path\" -u -e \"$LOCAL\" \"$REMOTE\"\n \treturn 0\n@@ -13,24 +15,5 @@ merge_cmd () {\n }\n \n translate_merge_tool_path() {\n-\t# Use WinMergeU.exe if it exists in $PATH\n-\tif type -p WinMergeU.exe >/dev/null 2>&1\n-\tthen\n-\t\tprintf WinMergeU.exe\n-\t\treturn\n-\tfi\n-\n-\t# Look for WinMergeU.exe in the typical locations\n-\twinmerge_exe=\"WinMerge/WinMergeU.exe\"\n-\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n-\t\tcut -d '=' -f 2- | sort -u)\n-\tdo\n-\t\tif test -n \"$directory\" && test -x \"$directory/$winmerge_exe\"\n-\t\tthen\n-\t\t\tprintf '%s' \"$directory/$winmerge_exe\"\n-\t\t\treturn\n-\t\tfi\n-\tdone\n-\n-\tprintf WinMergeU.exe\n+\tmergetool_find_win32_cmd \"WinMergeU.exe\" \"WinMerge\"\n }\n-- \n1.9.1\n"},{"id":"281645","messageId":"20160324074404.GA30574@gmail.com","threadId":"41758","inReplyTo":"1458773745-783-2-git-send-email-jacob.nisnevich@gmail.com","subject":"Re: [PATCH] mergetools: implemented new mergetool file for ExamDiff","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-03-24T07:44:04Z","receivedAt":"2016-03-24T07:44:04Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Mar 23, 2016 at 03:55:45PM -0700, Jacob Nisnevich wrote:\n> Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n> ---\n\nPlease write commit message in an imperative tone.\ne.g. \"mergetools: add support for ExamDiff\" might be a good summary.\n\n\n>  mergetools/examdiff           | 20 ++++++++++++++++++++\n>  mergetools/mergetools_helpers | 24 ++++++++++++++++++++++++\n>  mergetools/winmerge           | 23 +++--------------------\n>  3 files changed, 47 insertions(+), 20 deletions(-)\n>  create mode 100644 mergetools/examdiff\n>  create mode 100644 mergetools/mergetools_helpers\n\n\nThis patch is doing two things.\nIt's probably worth breaking this patch up into two parts.\n\nPatch 1 can add add the new helper function and update\nwinmerge to use it.\n\nPatch 2 can add the new examdiff helper.\n\n\n> diff --git a/mergetools/examdiff b/mergetools/examdiff\n> new file mode 100644\n> index 0000000..c5edd0e\n> --- /dev/null\n> +++ b/mergetools/examdiff\n> @@ -0,0 +1,20 @@\n> +. \"$MERGE_TOOLS_DIR/mergetools_helpers\"\n> +\n> +diff_cmd () {\n> +\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n> +}\n> +\n> +merge_cmd () {\n> +\ttouch \"$BACKUP\"\n> +\tif $base_present\n> +\tthen\n> +\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n> +\telse\n> +\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n> +\tfi\n> +\tcheck_unchanged\n> +}\n> +\n> +translate_merge_tool_path() {\n> +\tmergetool_find_win32_cmd \"ExamDiff.com\" \"ExamDiff Pro\"\n> +}\n> diff --git a/mergetools/mergetools_helpers b/mergetools/mergetools_helpers\n> new file mode 100644\n> index 0000000..46ae2d8\n> --- /dev/null\n> +++ b/mergetools/mergetools_helpers\n\n\nWe can probably do this without introducing a new file.  One\npossible home for this is with the rest of the \"default\"\ndefinitions of the functions in git-mergetool--lib.sh's\nsetup_tool() function.\n\nBut, that hints that we expect tools to override it.\n\nA better place would be as a normal function inside\ngit-mergetool--lib.sh, which more strongly hints that we do not\nexpect tools to override mergetool_find_win32_cmd().\n\n\n> @@ -0,0 +1,24 @@\n> +mergetool_find_win32_cmd () {\n> +\texecutable=$1\n> +\tfolder=$2\n> +\n> +\t# Use executable.com if it exists in $PATH\n> +\tif type -p $executable >/dev/null 2>&1\n> +\tthen\n> +\t\tprintf $executable\n\n\nIt might nut hurt to write this as,\n\n\t\tprintf '%s' \"$executable\"\n\n\nFor consistency and future-proofing.\n\n\n> +\t\treturn\n> +\tfi\n> +\n> +\t# Look for executable in the typical locations\n> +\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n> +\t\tcut -d '=' -f 2- | sort -u)\n> +\tdo\n> +\t\tif test -n \"$directory\" && test -x \"$directory/$folder/$executable\"\n> +\t\tthen\n> +\t\t\tprintf '%s' \"$directory/$folder/$executable\"\n> +\t\t\treturn\n> +\t\tfi\n> +\tdone\n> +\n> +\tprintf $executable\n> +}\n> diff --git a/mergetools/winmerge b/mergetools/winmerge\n> index 74a66d4..c785be8 100644\n> --- a/mergetools/winmerge\n> +++ b/mergetools/winmerge\n> @@ -1,3 +1,5 @@\n> +. \"$MERGE_TOOLS_DIR/mergetools_helpers\"\n> +\n\n\nIf we move the definition into mergetool--lib then we do not\nneed to dot-include any files here -- it'll simply be present\nand available.\n\n\n>  diff_cmd () {\n>  \t\"$merge_tool_path\" -u -e \"$LOCAL\" \"$REMOTE\"\n>  \treturn 0\n> @@ -13,24 +15,5 @@ merge_cmd () {\n>  }\n>  \n>  translate_merge_tool_path() {\n> -\t# Use WinMergeU.exe if it exists in $PATH\n> -\tif type -p WinMergeU.exe >/dev/null 2>&1\n> -\tthen\n> -\t\tprintf WinMergeU.exe\n> -\t\treturn\n> -\tfi\n> -\n> -\t# Look for WinMergeU.exe in the typical locations\n> -\twinmerge_exe=\"WinMerge/WinMergeU.exe\"\n> -\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n> -\t\tcut -d '=' -f 2- | sort -u)\n> -\tdo\n> -\t\tif test -n \"$directory\" && test -x \"$directory/$winmerge_exe\"\n> -\t\tthen\n> -\t\t\tprintf '%s' \"$directory/$winmerge_exe\"\n> -\t\t\treturn\n> -\t\tfi\n> -\tdone\n> -\n> -\tprintf WinMergeU.exe\n> +\tmergetool_find_win32_cmd \"WinMergeU.exe\" \"WinMerge\"\n>  }\n> -- \n> 1.9.1\n> \n-- \nDavid\n"},{"id":"281676","messageId":"xmqq60wbc24h.fsf@gitster.mtv.corp.google.com","threadId":"41758","inReplyTo":"20160324074404.GA30574@gmail.com","subject":"Re: [PATCH] mergetools: implemented new mergetool file for ExamDiff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-24T15:43:58Z","receivedAt":"2016-03-24T15:43:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> We can probably do this without introducing a new file.  One\n> possible home for this is with the rest of the \"default\"\n> definitions of the functions in git-mergetool--lib.sh's\n> setup_tool() function.\n>\n> But, that hints that we expect tools to override it.\n>\n> A better place would be as a normal function inside\n> git-mergetool--lib.sh, which more strongly hints that we do not\n> expect tools to override mergetool_find_win32_cmd().\n\nThanks for a clearly described set of rules that people can easily\nfollow.\n"},{"id":"281885","messageId":"1458946376-30296-1-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"xmqq60wbc24h.fsf@gitster.mtv.corp.google.com","subject":"[PATCH 0/2] add support for ExamDiff","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-25T22:52:54Z","receivedAt":"2016-03-25T22:52:54Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"I implemented all the changes you suggested and separated the patch into two\ndifferent patches. Thanks for all the help David.\n\nJacob Nisnevich (2):\n  mergetools: create mergetool_find_win32_cmd() helper function for\n    winmerge\n  mergetools: add support for ExamDiff\n\n git-mergetool--lib.sh | 25 +++++++++++++++++++++++++\n mergetools/examdiff   | 18 ++++++++++++++++++\n mergetools/winmerge   | 21 +--------------------\n 3 files changed, 44 insertions(+), 20 deletions(-)\n create mode 100644 mergetools/examdiff\n\n-- \n1.9.1\n"},{"id":"281886","messageId":"1458946376-30296-2-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"1458946376-30296-1-git-send-email-jacob.nisnevich@gmail.com","subject":"[PATCH 1/2] mergetools: create mergetool_find_win32_cmd() helper function for winmerge","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-25T22:52:55Z","receivedAt":"2016-03-25T22:52:55Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n---\n git-mergetool--lib.sh | 25 +++++++++++++++++++++++++\n mergetools/winmerge   | 21 +--------------------\n 2 files changed, 26 insertions(+), 20 deletions(-)\n\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex 54ac8e4..c5fa820 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -372,3 +372,28 @@ get_merge_tool () {\n \tfi\n \techo \"$merge_tool\"\n }\n+\n+mergetool_find_win32_cmd () {\n+\texecutable=$1\n+\tfolder=$2\n+\n+\t# Use executable.com if it exists in $PATH\n+\tif type -p $executable >/dev/null 2>&1\n+\tthen\n+\t\tprintf '%s' $executable\n+\t\treturn\n+\tfi\n+\n+\t# Look for executable in the typical locations\n+\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n+\t\tcut -d '=' -f 2- | sort -u)\n+\tdo\n+\t\tif test -n \"$directory\" && test -x \"$directory/$folder/$executable\"\n+\t\tthen\n+\t\t\tprintf '%s' \"$directory/$folder/$executable\"\n+\t\t\treturn\n+\t\tfi\n+\tdone\n+\n+\tprintf '%s' $executable\n+}\ndiff --git a/mergetools/winmerge b/mergetools/winmerge\nindex 74a66d4..f3819d3 100644\n--- a/mergetools/winmerge\n+++ b/mergetools/winmerge\n@@ -13,24 +13,5 @@ merge_cmd () {\n }\n \n translate_merge_tool_path() {\n-\t# Use WinMergeU.exe if it exists in $PATH\n-\tif type -p WinMergeU.exe >/dev/null 2>&1\n-\tthen\n-\t\tprintf WinMergeU.exe\n-\t\treturn\n-\tfi\n-\n-\t# Look for WinMergeU.exe in the typical locations\n-\twinmerge_exe=\"WinMerge/WinMergeU.exe\"\n-\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n-\t\tcut -d '=' -f 2- | sort -u)\n-\tdo\n-\t\tif test -n \"$directory\" && test -x \"$directory/$winmerge_exe\"\n-\t\tthen\n-\t\t\tprintf '%s' \"$directory/$winmerge_exe\"\n-\t\t\treturn\n-\t\tfi\n-\tdone\n-\n-\tprintf WinMergeU.exe\n+\tmergetool_find_win32_cmd \"WinMergeU.exe\" \"WinMerge\"\n }\n-- \n1.9.1\n"},{"id":"281884","messageId":"1458946376-30296-3-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"1458946376-30296-1-git-send-email-jacob.nisnevich@gmail.com","subject":"[PATCH 2/2] mergetools: add support for ExamDiff","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-25T22:52:56Z","receivedAt":"2016-03-25T22:52:56Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n---\n mergetools/examdiff | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)\n create mode 100644 mergetools/examdiff\n\ndiff --git a/mergetools/examdiff b/mergetools/examdiff\nnew file mode 100644\nindex 0000000..7b524d4\n--- /dev/null\n+++ b/mergetools/examdiff\n@@ -0,0 +1,18 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n+}\n+\n+merge_cmd () {\n+\ttouch \"$BACKUP\"\n+\tif $base_present\n+\tthen\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\telse\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\tfi\n+\tcheck_unchanged\n+}\n+\n+translate_merge_tool_path() {\n+\tmergetool_find_win32_cmd \"ExamDiff.com\" \"ExamDiff Pro\"\n+}\n-- \n1.9.1\n"},{"id":"281887","messageId":"xmqqio0a17ux.fsf@gitster.mtv.corp.google.com","threadId":"41758","inReplyTo":"1458946376-30296-2-git-send-email-jacob.nisnevich@gmail.com","subject":"Re: [PATCH 1/2] mergetools: create mergetool_find_win32_cmd() helper function for winmerge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-25T23:00:06Z","receivedAt":"2016-03-25T23:00:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Nisnevich <jacob.nisnevich@gmail.com> writes:\n\n> Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n> ---\n>  git-mergetool--lib.sh | 25 +++++++++++++++++++++++++\n>  mergetools/winmerge   | 21 +--------------------\n>  2 files changed, 26 insertions(+), 20 deletions(-)\n>\n> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\n> index 54ac8e4..c5fa820 100644\n> --- a/git-mergetool--lib.sh\n> +++ b/git-mergetool--lib.sh\n> @@ -372,3 +372,28 @@ get_merge_tool () {\n>  \tfi\n>  \techo \"$merge_tool\"\n>  }\n> +\n> +mergetool_find_win32_cmd () {\n> +\texecutable=$1\n> +\tfolder=$2\n> +\n> +\t# Use executable.com if it exists in $PATH\n\ns/executable.com/$executable/\n\n> +\tif type -p $executable >/dev/null 2>&1\n\nThis needs to be quoted,\n\n\tif type -p \"$executable\" >/dev/null 2>&1\n\n> +\tthen\n> +\t\tprintf '%s' $executable\n\nLikewise.\n\n> +\t\treturn\n> +\tfi\n> +\n> +\t# Look for executable in the typical locations\n> +\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n> +\t\tcut -d '=' -f 2- | sort -u)\n> +\tdo\n> +\t\tif test -n \"$directory\" && test -x \"$directory/$folder/$executable\"\n> +\t\tthen\n> +\t\t\tprintf '%s' \"$directory/$folder/$executable\"\n> +\t\t\treturn\n> +\t\tfi\n> +\tdone\n> +\n> +\tprintf '%s' $executable\n\nLikewise.\n\nOther than these points, I do not see anything wrong in this patch.\nThanks.\n\nBy the way, \"directory/folder/stuff\" sounds somewhat strange, no?\n"},{"id":"281891","messageId":"1458947877-31764-1-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"xmqqio0a17ux.fsf@gitster.mtv.corp.google.com","subject":"[PATCH 0/2] mergetools: add support for ExamDiff","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-25T23:17:55Z","receivedAt":"2016-03-25T23:17:55Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"OK I add the quotes and modified the comment. I also changed $folder to \n$sub_directory. I think that makes a little bit more sense and sounds a lot\nbetter.\n\nJacob Nisnevich (2):\n  mergetools: create mergetool_find_win32_cmd() helper function for\n    winmerge\n  mergetools: add support for ExamDiff\n\n git-mergetool--lib.sh | 25 +++++++++++++++++++++++++\n mergetools/examdiff   | 18 ++++++++++++++++++\n mergetools/winmerge   | 21 +--------------------\n 3 files changed, 44 insertions(+), 20 deletions(-)\n create mode 100644 mergetools/examdiff\n\n-- \n1.9.1\n"},{"id":"281892","messageId":"1458947877-31764-2-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"1458947877-31764-1-git-send-email-jacob.nisnevich@gmail.com","subject":"[PATCH 1/2] mergetools: create mergetool_find_win32_cmd() helper function for winmerge","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-25T23:17:56Z","receivedAt":"2016-03-25T23:17:56Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n---\n git-mergetool--lib.sh | 25 +++++++++++++++++++++++++\n mergetools/winmerge   | 21 +--------------------\n 2 files changed, 26 insertions(+), 20 deletions(-)\n\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex 54ac8e4..302c56d 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -372,3 +372,28 @@ get_merge_tool () {\n \tfi\n \techo \"$merge_tool\"\n }\n+\n+mergetool_find_win32_cmd () {\n+\texecutable=$1\n+\tsub_directory=$2\n+\n+\t# Use $executable if it exists in $PATH\n+\tif type -p \"$executable\" >/dev/null 2>&1\n+\tthen\n+\t\tprintf '%s' \"$executable\"\n+\t\treturn\n+\tfi\n+\n+\t# Look for executable in the typical locations\n+\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n+\t\tcut -d '=' -f 2- | sort -u)\n+\tdo\n+\t\tif test -n \"$directory\" && test -x \"$directory/$sub_directory/$executable\"\n+\t\tthen\n+\t\t\tprintf '%s' \"$directory/$sub_directory/$executable\"\n+\t\t\treturn\n+\t\tfi\n+\tdone\n+\n+\tprintf '%s' \"$executable\"\n+}\ndiff --git a/mergetools/winmerge b/mergetools/winmerge\nindex 74a66d4..f3819d3 100644\n--- a/mergetools/winmerge\n+++ b/mergetools/winmerge\n@@ -13,24 +13,5 @@ merge_cmd () {\n }\n \n translate_merge_tool_path() {\n-\t# Use WinMergeU.exe if it exists in $PATH\n-\tif type -p WinMergeU.exe >/dev/null 2>&1\n-\tthen\n-\t\tprintf WinMergeU.exe\n-\t\treturn\n-\tfi\n-\n-\t# Look for WinMergeU.exe in the typical locations\n-\twinmerge_exe=\"WinMerge/WinMergeU.exe\"\n-\tfor directory in $(env | grep -Ei '^PROGRAM(FILES(\\(X86\\))?|W6432)=' |\n-\t\tcut -d '=' -f 2- | sort -u)\n-\tdo\n-\t\tif test -n \"$directory\" && test -x \"$directory/$winmerge_exe\"\n-\t\tthen\n-\t\t\tprintf '%s' \"$directory/$winmerge_exe\"\n-\t\t\treturn\n-\t\tfi\n-\tdone\n-\n-\tprintf WinMergeU.exe\n+\tmergetool_find_win32_cmd \"WinMergeU.exe\" \"WinMerge\"\n }\n-- \n1.9.1\n"},{"id":"281893","messageId":"1458947877-31764-3-git-send-email-jacob.nisnevich@gmail.com","threadId":"41758","inReplyTo":"1458947877-31764-1-git-send-email-jacob.nisnevich@gmail.com","subject":"[PATCH 2/2] mergetools: add support for ExamDiff","fromName":"Jacob Nisnevich","fromEmail":"jacob.nisnevich@gmail.com","sentAt":"2016-03-25T23:17:57Z","receivedAt":"2016-03-25T23:17:57Z","isPatch":true,"sender":{"key":"jacob.nisnevich@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1996162?v=4"},"body":"Signed-off-by: Jacob Nisnevich <jacob.nisnevich@gmail.com>\n---\n mergetools/examdiff | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)\n create mode 100644 mergetools/examdiff\n\ndiff --git a/mergetools/examdiff b/mergetools/examdiff\nnew file mode 100644\nindex 0000000..7b524d4\n--- /dev/null\n+++ b/mergetools/examdiff\n@@ -0,0 +1,18 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -nh\n+}\n+\n+merge_cmd () {\n+\ttouch \"$BACKUP\"\n+\tif $base_present\n+\tthen\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\telse\n+\t\t\"$merge_tool_path\" -merge \"$LOCAL\" \"$REMOTE\" -o:\"$MERGED\" -nh\n+\tfi\n+\tcheck_unchanged\n+}\n+\n+translate_merge_tool_path() {\n+\tmergetool_find_win32_cmd \"ExamDiff.com\" \"ExamDiff Pro\"\n+}\n-- \n1.9.1\n"},{"id":"282493","messageId":"xmqqfuv5i4i7.fsf@gitster.mtv.corp.google.com","threadId":"41758","inReplyTo":"1458947877-31764-1-git-send-email-jacob.nisnevich@gmail.com","subject":"Re: [PATCH 0/2] mergetools: add support for ExamDiff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-01T18:10:56Z","receivedAt":"2016-04-01T18:10:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Nisnevich <jacob.nisnevich@gmail.com> writes:\n\n> OK I add the quotes and modified the comment. I also changed $folder to \n> $sub_directory. I think that makes a little bit more sense and sounds a lot\n> better.\n>\n> Jacob Nisnevich (2):\n>   mergetools: create mergetool_find_win32_cmd() helper function for\n>     winmerge\n>   mergetools: add support for ExamDiff\n>\n>  git-mergetool--lib.sh | 25 +++++++++++++++++++++++++\n>  mergetools/examdiff   | 18 ++++++++++++++++++\n>  mergetools/winmerge   | 21 +--------------------\n>  3 files changed, 44 insertions(+), 20 deletions(-)\n>  create mode 100644 mergetools/examdiff\n\nThis round looked good to me.\nDavid, does this look sensible to you?\n\nThanks.\n"},{"id":"282530","messageId":"20160402210239.GA6917@gmail.com","threadId":"41758","inReplyTo":"xmqqfuv5i4i7.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 0/2] mergetools: add support for ExamDiff","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-04-02T21:02:39Z","receivedAt":"2016-04-02T21:02:39Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Apr 01, 2016 at 11:10:56AM -0700, Junio C Hamano wrote:\n> Jacob Nisnevich <jacob.nisnevich@gmail.com> writes:\n> \n> > OK I add the quotes and modified the comment. I also changed $folder to \n> > $sub_directory. I think that makes a little bit more sense and sounds a lot\n> > better.\n> >\n> > Jacob Nisnevich (2):\n> >   mergetools: create mergetool_find_win32_cmd() helper function for\n> >     winmerge\n> >   mergetools: add support for ExamDiff\n> >\n> >  git-mergetool--lib.sh | 25 +++++++++++++++++++++++++\n> >  mergetools/examdiff   | 18 ++++++++++++++++++\n> >  mergetools/winmerge   | 21 +--------------------\n> >  3 files changed, 44 insertions(+), 20 deletions(-)\n> >  create mode 100644 mergetools/examdiff\n> \n> This round looked good to me.\n> David, does this look sensible to you?\n> \n> Thanks.\n\nYes, thank you.\n\nAcked-by: David Aguilar <davvid@gmail.com>\n\ncheers,\n-- \nDavid\n"}]}