{"thread":{"id":"39380","subject":"[PATCH v5 2/2] mergetools: add winmerge as a builtin tool","startedAt":"2015-05-20T09:02:41Z","lastAt":"2015-05-20T09:04:22Z","messageCount":3,"participants":["David Aguilar","Sebastian Schuberth"],"isPatch":true,"patchVersion":5,"patchTotal":2},"messages":[{"id":"261647","messageId":"1432112562-400-1-git-send-email-davvid@gmail.com","threadId":"39380","inReplyTo":null,"subject":"[PATCH v5 1/2] mergetool--lib: set IFS for difftool and mergetool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2015-05-20T09:02:41Z","receivedAt":"2015-05-20T09:02:41Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"git-sh-setup sets IFS but it is not used by git-difftool--helper.\nSet IFS in git-mergetool--lib so that the mergetool scriptlets,\ndiftool, and mergetool do not need to do so.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nThis patch is new since last time.  It simplifies the patch that follows.\n\n git-mergetool--lib.sh | 3 +++\n git-mergetool.sh      | 2 --\n 2 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex fe61e89..14b039d 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -2,6 +2,9 @@\n \n : ${MERGE_TOOLS_DIR=$(git --exec-path)/mergetools}\n \n+IFS='\n+'\n+\n mode_ok () {\n \tif diff_mode\n \tthen\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex d20581c..9f77e3a 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -451,8 +451,6 @@ fi\n printf \"Merging:\\n\"\n printf \"%s\\n\" \"$files\"\n \n-IFS='\n-'\n rc=0\n for i in $files\n do\n-- \n2.4.1.218.gc09a0e5\n"},{"id":"261646","messageId":"1432112562-400-2-git-send-email-davvid@gmail.com","threadId":"39380","inReplyTo":"1432112562-400-1-git-send-email-davvid@gmail.com","subject":"[PATCH v5 2/2] mergetools: add winmerge as a builtin tool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2015-05-20T09:02:42Z","receivedAt":"2015-05-20T09:02:42Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Add a winmerge scriptlet with the commands described in [1] so\nthat users can use winmerge without needing to perform any\nadditional configuration.\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/268631\n\nHelped-by: Philip Oakley <philipoakley@iee.org>\nHelped-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nHelped-by: Sebastian Schuberth <sschuberth@gmail.com>\nHelped-by: SZEDER Gábor <szeder@ira.uka.de>\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nChanges since v4: we no longer need to worry about IFS since\nit's already been set by patch 1/2.\n\n mergetools/winmerge | 37 +++++++++++++++++++++++++++++++++++++\n 1 file changed, 37 insertions(+)\n create mode 100644 mergetools/winmerge\n\ndiff --git a/mergetools/winmerge b/mergetools/winmerge\nnew file mode 100644\nindex 0000000..3e9f908\n--- /dev/null\n+++ b/mergetools/winmerge\n@@ -0,0 +1,37 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" -u -e \"$LOCAL\" \"$REMOTE\"\n+\treturn 0\n+}\n+\n+merge_cmd () {\n+\t# mergetool.winmerge.trustExitCode is implicitly false.\n+\t# touch $BACKUP so that we can check_unchanged.\n+\ttouch \"$BACKUP\"\n+\t\"$merge_tool_path\" -u -e -dl Local -dr Remote \\\n+\t\t\"$LOCAL\" \"$REMOTE\" \"$MERGED\"\n+\tcheck_unchanged\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+}\n-- \n2.4.1.218.gc09a0e5\n"},{"id":"261649","messageId":"CAHGBnuM4CcT9FVKJapzvvtrvFV6SxaGJKgzRtqQDNRroptH_Rw@mail.gmail.com","threadId":"39380","inReplyTo":"1432112562-400-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH v5 1/2] mergetool--lib: set IFS for difftool and mergetool","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2015-05-20T09:04:22Z","receivedAt":"2015-05-20T09:04:22Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Wed, May 20, 2015 at 11:02 AM, David Aguilar <davvid@gmail.com> wrote:\n\n> git-sh-setup sets IFS but it is not used by git-difftool--helper.\n> Set IFS in git-mergetool--lib so that the mergetool scriptlets,\n> diftool, and mergetool do not need to do so.\n\ns/diftool/difftool/\n\n-- \nSebastian Schuberth\n"}]}