{"thread":{"id":"35115","subject":"[PATCH v2] mergetools/diffmerge: support DiffMerge as a git mergetool","startedAt":"2013-10-12T05:01:10Z","lastAt":"2013-10-12T22:27:41Z","messageCount":3,"participants":["Stefan Saasen","David Aguilar"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"228772","messageId":"1381554070-12241-1-git-send-email-ssaasen@atlassian.com","threadId":"35115","inReplyTo":null,"subject":"[PATCH v2] mergetools/diffmerge: support DiffMerge as a git mergetool","fromName":"Stefan Saasen","fromEmail":"ssaasen@atlassian.com","sentAt":"2013-10-12T05:01:10Z","receivedAt":"2013-10-12T05:01:10Z","isPatch":true,"sender":{"key":"ssaasen@atlassian.com","avatar":null},"body":"DiffMerge is a non-free (but gratis) tool that supports OS X, Windows and Linux.\n\n    See http://www.sourcegear.com/diffmerge/\n\nDiffMerge includes a script `/usr/bin/diffmerge` that can be used to launch the\ngraphical compare tool.\n\nThis change adds mergetool support for DiffMerge and adds 'diffmerge' as an\noption to the mergetool help.\n\nSigned-off-by: Stefan Saasen <ssaasen@atlassian.com>\nAcked-by: David Aguilar <davvid@gmail.com>\n---\n contrib/completion/git-completion.bash |  2 +-\n git-mergetool--lib.sh                  |  3 ++-\n mergetools/diffmerge                   | 15 +++++++++++++++\n 3 files changed, 18 insertions(+), 2 deletions(-)\n create mode 100644 mergetools/diffmerge\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex e1b7313..07b0ba5 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1188,7 +1188,7 @@ _git_diff ()\n \t__git_complete_revlist_file\n }\n \n-__git_mergetools_common=\"diffuse ecmerge emerge kdiff3 meld opendiff\n+__git_mergetools_common=\"diffuse diffmerge ecmerge emerge kdiff3 meld opendiff\n \t\t\ttkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare\n \"\n \ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex feee6a4..0fcb253 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -250,7 +250,8 @@ list_merge_tool_candidates () {\n \t\telse\n \t\t\ttools=\"opendiff kdiff3 tkdiff xxdiff meld $tools\"\n \t\tfi\n-\t\ttools=\"$tools gvimdiff diffuse ecmerge p4merge araxis bc3 codecompare\"\n+\t\ttools=\"$tools gvimdiff diffuse diffmerge ecmerge \"\n+\t\ttools+=\"p4merge araxis bc3 codecompare\"\n \tfi\n \tcase \"${VISUAL:-$EDITOR}\" in\n \t*vim*)\ndiff --git a/mergetools/diffmerge b/mergetools/diffmerge\nnew file mode 100644\nindex 0000000..85ac720\n--- /dev/null\n+++ b/mergetools/diffmerge\n@@ -0,0 +1,15 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" \"$LOCAL\" \"$REMOTE\" >/dev/null 2>&1\n+}\n+\n+merge_cmd () {\n+\tif $base_present\n+\tthen\n+\t\t\"$merge_tool_path\" --merge --result=\"$MERGED\" \\\n+\t\t\t\"$LOCAL\" \"$BASE\" \"$REMOTE\"\n+\telse\n+\t\t\"$merge_tool_path\" --merge \\\n+\t\t\t--result=\"$MERGED\" \"$LOCAL\" \"$REMOTE\"\n+\tfi\n+\tstatus=$?\n+}\n-- \n1.8.2.3\n"},{"id":"228884","messageId":"CAJDDKr7LgCXjZLzZqKkkUnqt4EGdcA0wvf=uT8KZXba-+q00Sw@mail.gmail.com","threadId":"35115","inReplyTo":"1381554070-12241-1-git-send-email-ssaasen@atlassian.com","subject":"Re: [PATCH v2] mergetools/diffmerge: support DiffMerge as a git mergetool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-10-12T19:55:41Z","receivedAt":"2013-10-12T19:55:41Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Thanks for the re-roll.  We're very close; see below.\n\nOn Fri, Oct 11, 2013 at 10:01 PM, Stefan Saasen <ssaasen@atlassian.com> wrote:\n> DiffMerge is a non-free (but gratis) tool that supports OS X, Windows and Linux.\n>\n>     See http://www.sourcegear.com/diffmerge/\n>\n> DiffMerge includes a script `/usr/bin/diffmerge` that can be used to launch the\n> graphical compare tool.\n>\n> This change adds mergetool support for DiffMerge and adds 'diffmerge' as an\n> option to the mergetool help.\n>\n> Signed-off-by: Stefan Saasen <ssaasen@atlassian.com>\n> Acked-by: David Aguilar <davvid@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash |  2 +-\n>  git-mergetool--lib.sh                  |  3 ++-\n>  mergetools/diffmerge                   | 15 +++++++++++++++\n>  3 files changed, 18 insertions(+), 2 deletions(-)\n>  create mode 100644 mergetools/diffmerge\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index e1b7313..07b0ba5 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1188,7 +1188,7 @@ _git_diff ()\n>         __git_complete_revlist_file\n>  }\n>\n> -__git_mergetools_common=\"diffuse ecmerge emerge kdiff3 meld opendiff\n> +__git_mergetools_common=\"diffuse diffmerge ecmerge emerge kdiff3 meld opendiff\n>                         tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare\n>  \"\n>\n> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\n> index feee6a4..0fcb253 100644\n> --- a/git-mergetool--lib.sh\n> +++ b/git-mergetool--lib.sh\n> @@ -250,7 +250,8 @@ list_merge_tool_candidates () {\n>                 else\n>                         tools=\"opendiff kdiff3 tkdiff xxdiff meld $tools\"\n>                 fi\n> -               tools=\"$tools gvimdiff diffuse ecmerge p4merge araxis bc3 codecompare\"\n> +               tools=\"$tools gvimdiff diffuse diffmerge ecmerge \"\n> +               tools+=\"p4merge araxis bc3 codecompare\"\n\nI don't believe \"+=\" is portable across all POSIX shells.\n\nI tried this on \"dash\" (which is the default /bin/sh on Debian) and it\nwas not understood there.\n\n$ f=\"1 2 3\"\n$ f+=\" 4\"\n/bin/dash: 2: f+= 4: not found\n\nI think we should stick to the tools=\"$tools .....\" style of concatenation.\n\nEverything else looks good to me.\n\nThanks,\n-- \nDavid\n"},{"id":"228888","messageId":"CADoxLGM20QRihVLfbg0shdT2QZLjMBqvxy5N=AeLWR_TsTsugA@mail.gmail.com","threadId":"35115","inReplyTo":"CAJDDKr7LgCXjZLzZqKkkUnqt4EGdcA0wvf=uT8KZXba-+q00Sw@mail.gmail.com","subject":"Re: [PATCH v2] mergetools/diffmerge: support DiffMerge as a git mergetool","fromName":"Stefan Saasen","fromEmail":"ssaasen@atlassian.com","sentAt":"2013-10-12T22:27:41Z","receivedAt":"2013-10-12T22:27:41Z","isPatch":true,"sender":{"key":"ssaasen@atlassian.com","avatar":null},"body":"Not a problem. I'll change it to:\n\ntools=\"$tools gvimdiff diffuse diffmerge ecmerge\"\ntools=\"$tools p4merge araxis bc3 code compare\"\n\nand send a v3. Thanks for the review David.\n\n\nOn 13 October 2013 06:55, David Aguilar <davvid@gmail.com> wrote:\n> Thanks for the re-roll.  We're very close; see below.\n>\n> On Fri, Oct 11, 2013 at 10:01 PM, Stefan Saasen <ssaasen@atlassian.com> wrote:\n>> DiffMerge is a non-free (but gratis) tool that supports OS X, Windows and Linux.\n>>\n>>     See http://www.sourcegear.com/diffmerge/\n>>\n>> DiffMerge includes a script `/usr/bin/diffmerge` that can be used to launch the\n>> graphical compare tool.\n>>\n>> This change adds mergetool support for DiffMerge and adds 'diffmerge' as an\n>> option to the mergetool help.\n>>\n>> Signed-off-by: Stefan Saasen <ssaasen@atlassian.com>\n>> Acked-by: David Aguilar <davvid@gmail.com>\n>> ---\n>>  contrib/completion/git-completion.bash |  2 +-\n>>  git-mergetool--lib.sh                  |  3 ++-\n>>  mergetools/diffmerge                   | 15 +++++++++++++++\n>>  3 files changed, 18 insertions(+), 2 deletions(-)\n>>  create mode 100644 mergetools/diffmerge\n>>\n>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n>> index e1b7313..07b0ba5 100644\n>> --- a/contrib/completion/git-completion.bash\n>> +++ b/contrib/completion/git-completion.bash\n>> @@ -1188,7 +1188,7 @@ _git_diff ()\n>>         __git_complete_revlist_file\n>>  }\n>>\n>> -__git_mergetools_common=\"diffuse ecmerge emerge kdiff3 meld opendiff\n>> +__git_mergetools_common=\"diffuse diffmerge ecmerge emerge kdiff3 meld opendiff\n>>                         tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare\n>>  \"\n>>\n>> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\n>> index feee6a4..0fcb253 100644\n>> --- a/git-mergetool--lib.sh\n>> +++ b/git-mergetool--lib.sh\n>> @@ -250,7 +250,8 @@ list_merge_tool_candidates () {\n>>                 else\n>>                         tools=\"opendiff kdiff3 tkdiff xxdiff meld $tools\"\n>>                 fi\n>> -               tools=\"$tools gvimdiff diffuse ecmerge p4merge araxis bc3 codecompare\"\n>> +               tools=\"$tools gvimdiff diffuse diffmerge ecmerge \"\n>> +               tools+=\"p4merge araxis bc3 codecompare\"\n>\n> I don't believe \"+=\" is portable across all POSIX shells.\n>\n> I tried this on \"dash\" (which is the default /bin/sh on Debian) and it\n> was not understood there.\n>\n> $ f=\"1 2 3\"\n> $ f+=\" 4\"\n> /bin/dash: 2: f+= 4: not found\n>\n> I think we should stick to the tools=\"$tools .....\" style of concatenation.\n>\n> Everything else looks good to me.\n>\n> Thanks,\n> --\n> David\n"}]}