{"thread":{"id":"18714","subject":"[PATCH] mergetool-lib: add new merge tool TortoiseMerge","startedAt":"2009-04-04T13:18:02Z","lastAt":"2009-04-04T13:18:02Z","messageCount":1,"participants":["Markus Heidelberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"110334","messageId":"200904041518.03325.markus.heidelberg@web.de","threadId":"18714","inReplyTo":null,"subject":"[PATCH] mergetool-lib: add new merge tool TortoiseMerge","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-04-04T13:18:02Z","receivedAt":"2009-04-04T13:18:02Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"TortoiseMerge comes with TortoiseSVN or TortoiseGit for Windows. It can\nonly be used as a merge tool with an existing base file. It cannot be\nused without a base nor as a diff tool.\n\nThe documentation only mentions the slash '/' as command line option\nprefix, which refused to work, but the parser also accepts the dash '-'\n\nSee http://code.google.com/p/msysgit/issues/detail?id=226\n\nSigned-off-by: Markus Heidelberg <markus.heidelberg@web.de>\n---\n\nThis patch goes on top of the current difftool/mergetool patches from David.\nThis is 'da/difftool' in the current 'pu' and in addition:\n[PATCH] mergetool-lib: refactor run_mergetool and check_unchanged\n[PATCH] mergetool-lib: specialize opendiff options when in diff mode\n\nI couldn't recognize a special order so I put tortoisemerge at the end\nof the list.\n\n git-mergetool--lib.sh |   15 ++++++++++++++-\n 1 files changed, 14 insertions(+), 1 deletions(-)\n\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex 6f0e8f7..4ad2cb5 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -51,10 +51,13 @@ check_unchanged () {\n \n valid_tool () {\n \tcase \"$1\" in\n-\tkdiff3 | kompare | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | ecmerge | diffuse)\n+\tkdiff3 | kompare | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | ecmerge | diffuse | tortoisemerge)\n \t\tif test \"$1\" = \"kompare\" && ! diff_mode; then\n \t\t\treturn 1\n \t\tfi\n+\t\tif test \"$1\" = \"tortoisemerge\" && ! merge_mode; then\n+\t\t\treturn 1\n+\t\tfi\n \t\t;; # happy\n \t*)\n \t\tif test -z \"$(get_custom_cmd \"$1\")\"; then\n@@ -225,6 +228,16 @@ run_mergetool () {\n \t\tfi\n \t\tstatus=$?\n \t\t;;\n+\ttortoisemerge)\n+\t\tif $base_present; then\n+\t\t\ttouch \"$BACKUP\"\n+\t\t\t\"$merge_tool_path\" -base:\"$BASE\" -mine:\"$LOCAL\" -theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\t\tcheck_unchanged\n+\t\telse\n+\t\t\techo \"TortoiseMerge cannot be used without a base\" 1>&2\n+\t\t\tstatus=1\n+\t\tfi\n+\t\t;;\n \t*)\n \t\tif test -n \"$merge_tool_cmd\"; then\n \t\t\tif merge_mode &&\n-- \n1.6.2.2.428.gea44ab\n"}]}