{"thread":{"id":"18605","subject":"[PATCH] Add diffuse as merge and diff tool","startedAt":"2009-03-28T22:25:38Z","lastAt":"2009-03-30T16:41:33Z","messageCount":3,"participants":["Sebastian Pipping","David Aguilar"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"109736","messageId":"49CEA3E2.9020805@hartwork.org","threadId":"18605","inReplyTo":null,"subject":"[PATCH] Add diffuse as merge and diff tool","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2009-03-28T22:25:38Z","receivedAt":"2009-03-28T22:25:38Z","isPatch":true,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"\n\n\n>From e54c153a67cef9b162eb51f4b7cefb65e59c3a13 Mon Sep 17 00:00:00 2001\nFrom: Sebastian Pipping <sebastian@pipping.org>\nDate: Thu, 26 Mar 2009 20:42:31 +0100\nSubject: [PATCH] Add diffuse as merge and diff tool\n\n---\n Documentation/git-mergetool.txt        |    3 ++-\n Documentation/merge-config.txt         |    7 ++++---\n contrib/completion/git-completion.bash |    3 ++-\n contrib/difftool/git-difftool-helper   |   12 ++++++++----\n contrib/difftool/git-difftool.txt      |    4 ++--\n git-gui/lib/mergetool.tcl              |    7 +++++++\n git-mergetool.sh                       |   15 ++++++++++++---\n 7 files changed, 37 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex 5d3c632..c3a8092 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -26,7 +26,8 @@ OPTIONS\n --tool=<tool>::\n \tUse the merge resolution program specified by <tool>.\n \tValid merge tools are:\n-\tkdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff\n+\tkdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,\n+\tdiffuse and opendiff\n +\n If a merge resolution program is not specified, 'git-mergetool'\n will use the configuration variable `merge.tool`.  If the\ndiff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt\nindex 1ff08ff..ef07cf2 100644\n--- a/Documentation/merge-config.txt\n+++ b/Documentation/merge-config.txt\n@@ -22,9 +22,10 @@ merge.stat::\n merge.tool::\n \tControls which merge resolution program is used by\n \tlinkgit:git-mergetool[1].  Valid built-in values are: \"kdiff3\",\n-\t\"tkdiff\", \"meld\", \"xxdiff\", \"emerge\", \"vimdiff\", \"gvimdiff\", and\n-\t\"opendiff\".  Any other value is treated is custom merge tool\n-\tand there must be a corresponding mergetool.<tool>.cmd option.\n+\t\"tkdiff\", \"meld\", \"xxdiff\", \"emerge\", \"vimdiff\", \"gvimdiff\",\n+\t\"diffuse\" and \"opendiff\".  Any other value is treated is custom\n+\tmerge tool and there must be a corresponding mergetool.<tool>.cmd\n+\toption.\n \n merge.verbosity::\n \tControls the amount of output shown by the recursive merge\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1c6b0e2..2e7a9d7 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1173,7 +1173,8 @@ _git_mergetool ()\n \t--tool=*)\n \t\t__gitcomp \"\n \t\t\tkdiff3 tkdiff meld xxdiff emerge\n-\t\t\tvimdiff gvimdiff ecmerge opendiff\n+\t\t\tvimdiff gvimdiff ecmerge diffuse\n+\t\t\topendiff\n \t\t\t\" \"\" \"${cur##--tool=}\"\n \t\treturn\n \t\t;;\ndiff --git a/contrib/difftool/git-difftool-helper b/contrib/difftool/git-difftool-helper\nindex 9c0a134..ea44e4e 100755\n--- a/contrib/difftool/git-difftool-helper\n+++ b/contrib/difftool/git-difftool-helper\n@@ -1,6 +1,6 @@\n #!/bin/sh\n # git-difftool-helper is a GIT_EXTERNAL_DIFF-compatible diff tool launcher.\n-# It supports kdiff3, kompare, tkdiff, xxdiff, meld, opendiff,\n+# It supports kdiff3, kompare, tkdiff, xxdiff, meld, diffuse, opendiff,\n # emerge, ecmerge, vimdiff, gvimdiff, and custom user-configurable tools.\n # This script is typically launched by using the 'git difftool'\n # convenience command.\n@@ -103,6 +103,10 @@ launch_merge_tool () {\n \t\t\t\"$LOCAL\" \"$REMOTE\"\n \t\t;;\n \n+\tdiffuse)\n+\t\t\"$merge_tool_path\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"\n+\t\t;;\n+\n \topendiff)\n \t\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" \\\n \t\t\t-merge \"$MERGED\" | cat\n@@ -140,7 +144,7 @@ valid_custom_tool() {\n # Built-in merge tools are always valid.\n valid_tool() {\n \tcase \"$1\" in\n-\tkdiff3 | kompare | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | ecmerge)\n+\tkdiff3 | kompare | tkdiff | xxdiff | meld | diffuse | opendiff | emerge | vimdiff | gvimdiff | ecmerge)\n \t\t;; # happy\n \t*)\n \t\tif ! valid_custom_tool \"$1\"\n@@ -194,9 +198,9 @@ if test -z \"$merge_tool\"; then\n \tif test -n \"$DISPLAY\"; then\n \t\t# If gnome then prefer meld, otherwise, prefer kdiff3 or kompare\n \t\tif test -n \"$GNOME_DESKTOP_SESSION_ID\" ; then\n-\t\t\tmerge_tool_candidates=\"meld kdiff3 kompare tkdiff xxdiff gvimdiff\"\n+\t\t\tmerge_tool_candidates=\"meld kdiff3 kompare tkdiff xxdiff gvimdiff diffuse\"\n \t\telse\n-\t\t\tmerge_tool_candidates=\"kdiff3 kompare tkdiff xxdiff meld gvimdiff\"\n+\t\t\tmerge_tool_candidates=\"kdiff3 kompare tkdiff xxdiff meld gvimdiff diffuse\"\n \t\tfi\n \tfi\n \tif echo \"${VISUAL:-$EDITOR}\" | grep 'emacs' > /dev/null 2>&1; then\ndiff --git a/contrib/difftool/git-difftool.txt b/contrib/difftool/git-difftool.txt\nindex 2b7bc03..6419d37 100644\n--- a/contrib/difftool/git-difftool.txt\n+++ b/contrib/difftool/git-difftool.txt\n@@ -28,8 +28,8 @@ OPTIONS\n --tool=<tool>::\n \tUse the merge resolution program specified by <tool>.\n \tValid merge tools are:\n-\tkdiff3, kompare, tkdiff, meld, xxdiff, emerge,\n-\tvimdiff, gvimdiff, ecmerge, and opendiff\n+\tkdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,\n+\tecmerge, diffuse and opendiff\n +\n If a merge resolution program is not specified, 'git-difftool'\n will use the configuration variable `diff.tool`.  If the\ndiff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl\nindex eb2b4b5..658c021 100644\n--- a/git-gui/lib/mergetool.tcl\n+++ b/git-gui/lib/mergetool.tcl\n@@ -219,6 +219,13 @@ proc merge_resolve_tool2 {} {\n \t\t\tset cmdline [list \"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" -merge \"$MERGED\"]\n \t\t}\n \t}\n+\tdiffuse {\n+\t\tif {$base_stage ne {}} {\n+\t\t\tset cmdline [list \"$merge_tool_path\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\" \"$BASE\" ]\n+\t\t} else {\n+\t\t\tset cmdline [list \"$merge_tool_path\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\" ]\n+\t\t}\n+\t}\n \tecmerge {\n \t\tif {$base_stage ne {}} {\n \t\t\tset cmdline [list \"$merge_tool_path\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" --default --mode=merge3 --to=\"$MERGED\"]\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 87fa88a..2c96da1 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -239,6 +239,15 @@ merge_file () {\n \t    fi\n \t    check_unchanged\n \t    ;;\n+\tdiffuse)\n+\t    touch \"$BACKUP\"\n+\t    if base_present; then\n+\t\t\"$merge_tool_path\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\" \"$BASE\" | cat\n+\t    else\n+\t\t\"$merge_tool_path\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\" | cat\n+\t    fi\n+\t    check_unchanged\n+\t    ;;\n \topendiff)\n \t    touch \"$BACKUP\"\n \t    if base_present; then\n@@ -345,7 +354,7 @@ valid_custom_tool()\n \n valid_tool() {\n \tcase \"$1\" in\n-\t\tkdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | ecmerge)\n+\t\tkdiff3 | tkdiff | xxdiff | meld | diffuse | opendiff | emerge | vimdiff | gvimdiff | ecmerge)\n \t\t\t;; # happy\n \t\t*)\n \t\t\tif ! valid_custom_tool \"$1\"; then\n@@ -398,9 +407,9 @@ fi\n if test -z \"$merge_tool\" ; then\n     if test -n \"$DISPLAY\"; then\n         if test -n \"$GNOME_DESKTOP_SESSION_ID\" ; then\n-            merge_tool_candidates=\"meld kdiff3 tkdiff xxdiff gvimdiff\"\n+            merge_tool_candidates=\"meld kdiff3 tkdiff xxdiff gvimdiff diffuse\"\n         else\n-            merge_tool_candidates=\"kdiff3 tkdiff xxdiff meld gvimdiff\"\n+            merge_tool_candidates=\"kdiff3 tkdiff xxdiff meld gvimdiff diffuse\"\n         fi\n     fi\n     if echo \"${VISUAL:-$EDITOR}\" | grep 'emacs' > /dev/null 2>&1; then\n-- \n1.6.2.1-2808-gb0085a7\n\n"},{"id":"109814","messageId":"20090330045522.GA8308@gmail.com","threadId":"18605","inReplyTo":"49CEA3E2.9020805@hartwork.org","subject":"Re: [PATCH] Add diffuse as merge and diff tool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-03-30T04:55:23Z","receivedAt":"2009-03-30T04:55:23Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"\nHi\n\nOn  0, Sebastian Pipping <webmaster@hartwork.org> wrote:\n> \n\n> From e54c153a67cef9b162eb51f4b7cefb65e59c3a13 Mon Sep 17 00:00:00 2001\n> From: Sebastian Pipping <sebastian@pipping.org>\n> Date: Thu, 26 Mar 2009 20:42:31 +0100\n> Subject: [PATCH] Add diffuse as merge and diff tool\n> \n> ---\n>  Documentation/git-mergetool.txt        |    3 ++-\n>  Documentation/merge-config.txt         |    7 ++++---\n>  contrib/completion/git-completion.bash |    3 ++-\n>  contrib/difftool/git-difftool-helper   |   12 ++++++++----\n>  contrib/difftool/git-difftool.txt      |    4 ++--\n>  git-gui/lib/mergetool.tcl              |    7 +++++++\n>  git-mergetool.sh                       |   15 ++++++++++++---\n>  7 files changed, 37 insertions(+), 14 deletions(-)\n\n\nHey, thanks for the patch.\nOuch.. too many places with duplicated information, huh?\n\nI'm in the middle of refactoring git-(diff|merge)tool so that\nthere is less duplication of code.\n\nJunio also has a number of difftool-related patches in his\nproposed-updates \"pu\" branch.\n\nSebastian, would you mind if I rebased your patch on top of my\nwork (once I send it out) so that it makes things easier on\nour kind maintainer?  I have a big patch series coming down that\ndoes away with the redundancies so I think it'd be best if we\ntransfered your changes on top of it.  Would you mind if I\nrebased your patch and sent it out to the list?\n\nIt wouldn't be until much later tonight (or tomorrow) at the\nearliest since I have some unpacking to take care of but if\nthat's cool with you just let me know.\n\nYou should see the refactoring patches from me shortly...\n\n\n\n-- \n\t\tDavid\n"},{"id":"109924","messageId":"49D0F63D.2050205@hartwork.org","threadId":"18605","inReplyTo":"20090330045522.GA8308@gmail.com","subject":"Re: [PATCH] Add diffuse as merge and diff tool","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2009-03-30T16:41:33Z","receivedAt":"2009-03-30T16:41:33Z","isPatch":true,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"David Aguilar wrote:\n>>  Documentation/git-mergetool.txt        |    3 ++-\n>>  Documentation/merge-config.txt         |    7 ++++---\n>>  contrib/completion/git-completion.bash |    3 ++-\n>>  contrib/difftool/git-difftool-helper   |   12 ++++++++----\n>>  contrib/difftool/git-difftool.txt      |    4 ++--\n>>  git-gui/lib/mergetool.tcl              |    7 +++++++\n>>  git-mergetool.sh                       |   15 ++++++++++++---\n>>  7 files changed, 37 insertions(+), 14 deletions(-)\n> \n> \n> Hey, thanks for the patch.\n> Ouch.. too many places with duplicated information, huh?\n\nYes.\n\n\n> I'm in the middle of refactoring git-(diff|merge)tool so that\n> there is less duplication of code.\n> \n> Junio also has a number of difftool-related patches in his\n> proposed-updates \"pu\" branch.\n> \n> Sebastian, would you mind if I rebased your patch on top of my\n> work (once I send it out) so that it makes things easier on\n> our kind maintainer?  I have a big patch series coming down that\n> does away with the redundancies so I think it'd be best if we\n> transfered your changes on top of it.  Would you mind if I\n> rebased your patch and sent it out to the list?\n> \n> It wouldn't be until much later tonight (or tomorrow) at the\n> earliest since I have some unpacking to take care of but if\n> that's cool with you just let me know.\n> \n> You should see the refactoring patches from me shortly...\n\nMy patch is your patch, do as you please.\n\nJust take care to keep the order of the files passed\nto Diffuse intact, especially with $MERGED second,\nas Diffuse sets focus on the second document after startup.\n\n\n\nSebastian\n"}]}