{"thread":{"id":"32675","subject":"[PATCH] mergetools: Add tortoisegitmerge helper","startedAt":"2013-01-20T11:27:41Z","lastAt":"2013-02-02T02:08:18Z","messageCount":31,"participants":["Sven Strickroth","Junio C Hamano","David Aguilar","John Keeping","Sebastian Schuberth"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"207291","messageId":"50FBD4AD.2060208@tu-clausthal.de","threadId":"32675","inReplyTo":null,"subject":"[PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-20T11:27:41Z","receivedAt":"2013-01-20T11:27:41Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"- The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n  (starting with 1.8.0) in order to make clear that this one has special\n  support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n  version.\n- The tortoisemerge mergetool does not work with filenames which have\n  a space in it. Fixing this required changes in git and also in\n  TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n\nThe new tortoisegitmerge helper was added so that people can still use\nTortoiseMerge from TortoiseSVN (and older TortoiseGit versions).\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\nReported-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n Documentation/diff-config.txt          |  4 ++--\n Documentation/git-mergetool.txt        |  4 ++--\n Documentation/merge-config.txt         |  6 +++---\n contrib/completion/git-completion.bash |  2 +-\n git-mergetool--lib.sh                  |  2 +-\n mergetools/tortoisegitmerge            | 17 +++++++++++++++++\n 6 files changed, 26 insertions(+), 9 deletions(-)\n create mode 100644 mergetools/tortoisegitmerge\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex 4314ad0..13cbe5b 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::\n diff.tool::\n \tThe diff tool to be used by linkgit:git-difftool[1].  This\n \toption overrides `merge.tool`, and has the same valid built-in\n-\tvalues as `merge.tool` minus \"tortoisemerge\" and plus\n-\t\"kompare\".  Any other value is treated as a custom diff tool,\n+\tvalues as `merge.tool` minus \"tortoisemerge\"/\"tortoisegitmerge\" and\n+\tplus \"kompare\".  Any other value is treated as a custom diff tool,\n \tand there must be a corresponding `difftool.<tool>.cmd`\n \toption.\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex 6b563c5..a80cccd 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -28,8 +28,8 @@ OPTIONS\n --tool=<tool>::\n \tUse the merge resolution program specified by <tool>.\n \tValid values include emerge, gvimdiff, kdiff3,\n-\tmeld, vimdiff, and tortoisemerge. Run `git mergetool --tool-help`\n-\tfor the list of valid <tool> settings.\n+\tmeld, vimdiff, tortoisegitmerge, and tortoisemerge. Run\n+\t`git mergetool --tool-help` for the list of valid <tool> settings.\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 9bb4956..a047646 100644\n--- a/Documentation/merge-config.txt\n+++ b/Documentation/merge-config.txt\n@@ -55,9 +55,9 @@ merge.tool::\n \tControls which merge resolution program is used by\n \tlinkgit:git-mergetool[1].  Valid built-in values are: \"araxis\",\n \t\"bc3\", \"diffuse\", \"ecmerge\", \"emerge\", \"gvimdiff\", \"kdiff3\", \"meld\",\n-\t\"opendiff\", \"p4merge\", \"tkdiff\", \"tortoisemerge\", \"vimdiff\"\n-\tand \"xxdiff\".  Any other value is treated is custom merge tool\n-\tand there must be a corresponding mergetool.<tool>.cmd option.\n+\t\"opendiff\", \"p4merge\", \"tkdiff\", \"tortoisegitmerge\", \"tortoisemerge\",\n+\t\"vimdiff\" and \"xxdiff\".  Any other value is treated is custom merge\n+\ttool and there must be a corresponding mergetool.<tool>.cmd option.\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 90f5f05..5332a33 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1345,7 +1345,7 @@ _git_mergetool ()\n {\n \tcase \"$cur\" in\n \t--tool=*)\n-\t\t__gitcomp \"$__git_mergetools_common tortoisemerge\" \"\" \"${cur##--tool=}\"\n+\t\t__gitcomp \"$__git_mergetools_common tortoisegitmerge tortoisemerge\" \"\" \"${cur##--tool=}\"\n \t\treturn\n \t\t;;\n \t--*)\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex f013a03..47183ef 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -150,7 +150,7 @@ run_merge_cmd () {\n list_merge_tool_candidates () {\n \tif merge_mode\n \tthen\n-\t\ttools=\"tortoisemerge\"\n+\t\ttools=\"tortoisegitmerge tortoisemerge\"\n \telse\n \t\ttools=\"kompare\"\n \tfi\ndiff --git a/mergetools/tortoisegitmerge b/mergetools/tortoisegitmerge\nnew file mode 100644\nindex 0000000..5b802a7\n--- /dev/null\n+++ b/mergetools/tortoisegitmerge\n@@ -0,0 +1,17 @@\n+can_diff () {\n+\treturn 1\n+}\n+\n+merge_cmd () {\n+\tif $base_present\n+\tthen\n+\t\ttouch \"$BACKUP\"\n+\t\t\"$merge_tool_path\" \\\n+\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n+\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n+\t\tcheck_unchanged\n+\telse\n+\t\techo \"TortoiseGitMerge cannot be used without a base\" 1>&2\n+\t\treturn 1\n+\tfi\n+}\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207347","messageId":"7v4nibjrg0.fsf@alter.siamese.dyndns.org","threadId":"32675","inReplyTo":"50FBD4AD.2060208@tu-clausthal.de","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-21T00:43:59Z","receivedAt":"2013-01-21T00:43:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n\n> - The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n>   (starting with 1.8.0) in order to make clear that this one has special\n>   support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n>   version.\n> - The tortoisemerge mergetool does not work with filenames which have\n>   a space in it. Fixing this required changes in git and also in\n>   TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n>\n> The new tortoisegitmerge helper was added so that people can still use\n> TortoiseMerge from TortoiseSVN (and older TortoiseGit versions).\n>\n> Signed-off-by: Sven Strickroth <email@cs-ware.de>\n> Reported-by: Sebastian Schuberth <sschuberth@gmail.com>\n> ---\n\nApplying: mergetools: Add tortoisegitmerge helper\nfatal: corrupt patch at line 56\n\nThat comes from here:\n\n> diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt\n> index 9bb4956..a047646 100644\n> --- a/Documentation/merge-config.txt\n> +++ b/Documentation/merge-config.txt\n> @@ -55,9 +55,9 @@ merge.tool::\n>  \tControls which merge resolution program is used by\n>  \tlinkgit:git-mergetool[1].  Valid built-in values are: \"araxis\",\n>  \t\"bc3\", \"diffuse\", \"ecmerge\", \"emerge\", \"gvimdiff\", \"kdiff3\", \"meld\",\n> -\t\"opendiff\", \"p4merge\", \"tkdiff\", \"tortoisemerge\", \"vimdiff\"\n> -\tand \"xxdiff\".  Any other value is treated is custom merge tool\n> -\tand there must be a corresponding mergetool.<tool>.cmd option.\n> +\t\"opendiff\", \"p4merge\", \"tkdiff\", \"tortoisegitmerge\", \"tortoisemerge\",\n> +\t\"vimdiff\" and \"xxdiff\".  Any other value is treated is custom merge\n> +\ttool and there must be a corresponding mergetool.<tool>.cmd option.\n>   merge.verbosity::\n>  \tControls the amount of output shown by the recursive merge\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n\nNotice that we have three pre-context lines but only two\npost-context lines for this hunk.  There is one context line missing\nat the end of this hunk.\n\nI'd usually try to queue a corrupt patch by manually fixing up when\nit is a trivial corruption, but a corruption that _loses_ lines is\ntoo dangerous to be handled that way.  There may be additions in\nother hunks you wanted to make that were lost for the same reason\nwhy the post-context line was lost here, and my fix-up would end up\ncommitting a wrong patch.\n\nPlease investigate how this happened, and re-send after hearing\nreviews from others.\n\nThanks.\n"},{"id":"207370","messageId":"50FCFB37.2060708@tu-clausthal.de","threadId":"32675","inReplyTo":"7v4nibjrg0.fsf@alter.siamese.dyndns.org","subject":"[PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-21T08:24:23Z","receivedAt":"2013-01-21T08:24:23Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"- The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n  (starting with 1.8.0) in order to make clear that this one has special\n  support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n  version.\n- The tortoisemerge mergetool does not work with filenames which have\n  a space in it. Fixing this required changes in git and also in\n  TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n\nThe new tortoisegitmerge helper was added so that people can still use\nTortoiseMerge from TortoiseSVN (and older TortoiseGit versions).\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\nIdea-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n Documentation/diff-config.txt          |  4 ++--\n Documentation/git-mergetool.txt        |  4 ++--\n Documentation/merge-config.txt         |  6 +++---\n contrib/completion/git-completion.bash |  2 +-\n git-mergetool--lib.sh                  |  2 +-\n mergetools/tortoisegitmerge            | 17 +++++++++++++++++\n 6 files changed, 26 insertions(+), 9 deletions(-)\n create mode 100644 mergetools/tortoisegitmerge\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex 4314ad0..13cbe5b 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::\n diff.tool::\n \tThe diff tool to be used by linkgit:git-difftool[1].  This\n \toption overrides `merge.tool`, and has the same valid built-in\n-\tvalues as `merge.tool` minus \"tortoisemerge\" and plus\n-\t\"kompare\".  Any other value is treated as a custom diff tool,\n+\tvalues as `merge.tool` minus \"tortoisemerge\"/\"tortoisegitmerge\" and\n+\tplus \"kompare\".  Any other value is treated as a custom diff tool,\n \tand there must be a corresponding `difftool.<tool>.cmd`\n \toption.\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex 6b563c5..a80cccd 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -28,8 +28,8 @@ OPTIONS\n --tool=<tool>::\n \tUse the merge resolution program specified by <tool>.\n \tValid values include emerge, gvimdiff, kdiff3,\n-\tmeld, vimdiff, and tortoisemerge. Run `git mergetool --tool-help`\n-\tfor the list of valid <tool> settings.\n+\tmeld, vimdiff, tortoisegitmerge, and tortoisemerge. Run\n+\t`git mergetool --tool-help` for the list of valid <tool> settings.\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 9bb4956..a047646 100644\n--- a/Documentation/merge-config.txt\n+++ b/Documentation/merge-config.txt\n@@ -55,9 +55,9 @@ merge.tool::\n \tControls which merge resolution program is used by\n \tlinkgit:git-mergetool[1].  Valid built-in values are: \"araxis\",\n \t\"bc3\", \"diffuse\", \"ecmerge\", \"emerge\", \"gvimdiff\", \"kdiff3\", \"meld\",\n-\t\"opendiff\", \"p4merge\", \"tkdiff\", \"tortoisemerge\", \"vimdiff\"\n-\tand \"xxdiff\".  Any other value is treated is custom merge tool\n-\tand there must be a corresponding mergetool.<tool>.cmd option.\n+\t\"opendiff\", \"p4merge\", \"tkdiff\", \"tortoisegitmerge\", \"tortoisemerge\",\n+\t\"vimdiff\" and \"xxdiff\".  Any other value is treated is custom merge\n+\ttool and there must be a corresponding mergetool.<tool>.cmd option.\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 14dd5e7..1557d54 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1345,7 +1345,7 @@ _git_mergetool ()\n {\n \tcase \"$cur\" in\n \t--tool=*)\n-\t\t__gitcomp \"$__git_mergetools_common tortoisemerge\" \"\" \"${cur##--tool=}\"\n+\t\t__gitcomp \"$__git_mergetools_common tortoisegitmerge tortoisemerge\" \"\" \"${cur##--tool=}\"\n \t\treturn\n \t\t;;\n \t--*)\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex f013a03..47183ef 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -150,7 +150,7 @@ run_merge_cmd () {\n list_merge_tool_candidates () {\n \tif merge_mode\n \tthen\n-\t\ttools=\"tortoisemerge\"\n+\t\ttools=\"tortoisegitmerge tortoisemerge\"\n \telse\n \t\ttools=\"kompare\"\n \tfi\ndiff --git a/mergetools/tortoisegitmerge b/mergetools/tortoisegitmerge\nnew file mode 100644\nindex 0000000..5b802a7\n--- /dev/null\n+++ b/mergetools/tortoisegitmerge\n@@ -0,0 +1,17 @@\n+can_diff () {\n+\treturn 1\n+}\n+\n+merge_cmd () {\n+\tif $base_present\n+\tthen\n+\t\ttouch \"$BACKUP\"\n+\t\t\"$merge_tool_path\" \\\n+\t\t\t-base=\"$BASE\" -mine=\"$LOCAL\" \\\n+\t\t\t-theirs=\"$REMOTE\" -merged=\"$MERGED\"\n+\t\tcheck_unchanged\n+\telse\n+\t\techo \"TortoiseGitMerge cannot be used without a base\" 1>&2\n+\t\treturn 1\n+\tfi\n+}\n-- \n1.8.0.msysgit.0\n"},{"id":"207371","messageId":"50FCFBBB.2080305@tu-clausthal.de","threadId":"32675","inReplyTo":"7v4nibjrg0.fsf@alter.siamese.dyndns.org","subject":"[PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-21T08:26:35Z","receivedAt":"2013-01-21T08:26:35Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"- The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n  (starting with 1.8.0) in order to make clear that this one has special\n  support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n  version.\n- The tortoisemerge mergetool does not work with filenames which have\n  a space in it. Fixing this required changes in git and also in\n  TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n\nThe new tortoisegitmerge helper was added so that people can still use\nTortoiseMerge from TortoiseSVN (and older TortoiseGit versions).\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\nIdea-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n Documentation/diff-config.txt          |  4 ++--\n Documentation/git-mergetool.txt        |  4 ++--\n Documentation/merge-config.txt         |  6 +++---\n contrib/completion/git-completion.bash |  2 +-\n git-mergetool--lib.sh                  |  2 +-\n mergetools/tortoisegitmerge            | 17 +++++++++++++++++\n 6 files changed, 26 insertions(+), 9 deletions(-)\n create mode 100644 mergetools/tortoisegitmerge\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex 4314ad0..13cbe5b 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::\n diff.tool::\n \tThe diff tool to be used by linkgit:git-difftool[1].  This\n \toption overrides `merge.tool`, and has the same valid built-in\n-\tvalues as `merge.tool` minus \"tortoisemerge\" and plus\n-\t\"kompare\".  Any other value is treated as a custom diff tool,\n+\tvalues as `merge.tool` minus \"tortoisemerge\"/\"tortoisegitmerge\" and\n+\tplus \"kompare\".  Any other value is treated as a custom diff tool,\n \tand there must be a corresponding `difftool.<tool>.cmd`\n \toption.\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex 6b563c5..a80cccd 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -28,8 +28,8 @@ OPTIONS\n --tool=<tool>::\n \tUse the merge resolution program specified by <tool>.\n \tValid values include emerge, gvimdiff, kdiff3,\n-\tmeld, vimdiff, and tortoisemerge. Run `git mergetool --tool-help`\n-\tfor the list of valid <tool> settings.\n+\tmeld, vimdiff, tortoisegitmerge, and tortoisemerge. Run\n+\t`git mergetool --tool-help` for the list of valid <tool> settings.\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 9bb4956..a047646 100644\n--- a/Documentation/merge-config.txt\n+++ b/Documentation/merge-config.txt\n@@ -55,9 +55,9 @@ merge.tool::\n \tControls which merge resolution program is used by\n \tlinkgit:git-mergetool[1].  Valid built-in values are: \"araxis\",\n \t\"bc3\", \"diffuse\", \"ecmerge\", \"emerge\", \"gvimdiff\", \"kdiff3\", \"meld\",\n-\t\"opendiff\", \"p4merge\", \"tkdiff\", \"tortoisemerge\", \"vimdiff\"\n-\tand \"xxdiff\".  Any other value is treated is custom merge tool\n-\tand there must be a corresponding mergetool.<tool>.cmd option.\n+\t\"opendiff\", \"p4merge\", \"tkdiff\", \"tortoisegitmerge\", \"tortoisemerge\",\n+\t\"vimdiff\" and \"xxdiff\".  Any other value is treated is custom merge\n+\ttool and there must be a corresponding mergetool.<tool>.cmd option.\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 14dd5e7..1557d54 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1345,7 +1345,7 @@ _git_mergetool ()\n {\n \tcase \"$cur\" in\n \t--tool=*)\n-\t\t__gitcomp \"$__git_mergetools_common tortoisemerge\" \"\" \"${cur##--tool=}\"\n+\t\t__gitcomp \"$__git_mergetools_common tortoisegitmerge tortoisemerge\" \"\" \"${cur##--tool=}\"\n \t\treturn\n \t\t;;\n \t--*)\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex f013a03..47183ef 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -150,7 +150,7 @@ run_merge_cmd () {\n list_merge_tool_candidates () {\n \tif merge_mode\n \tthen\n-\t\ttools=\"tortoisemerge\"\n+\t\ttools=\"tortoisegitmerge tortoisemerge\"\n \telse\n \t\ttools=\"kompare\"\n \tfi\ndiff --git a/mergetools/tortoisegitmerge b/mergetools/tortoisegitmerge\nnew file mode 100644\nindex 0000000..5b802a7\n--- /dev/null\n+++ b/mergetools/tortoisegitmerge\n@@ -0,0 +1,17 @@\n+can_diff () {\n+\treturn 1\n+}\n+\n+merge_cmd () {\n+\tif $base_present\n+\tthen\n+\t\ttouch \"$BACKUP\"\n+\t\t\"$merge_tool_path\" \\\n+\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n+\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n+\t\tcheck_unchanged\n+\telse\n+\t\techo \"TortoiseGitMerge cannot be used without a base\" 1>&2\n+\t\treturn 1\n+\tfi\n+}\n-- \n1.8.0.msysgit.0\n"},{"id":"207689","messageId":"510118C1.9080704@tu-clausthal.de","threadId":"32675","inReplyTo":"50FCFBBB.2080305@tu-clausthal.de","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-24T11:19:29Z","receivedAt":"2013-01-24T11:19:29Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"Am 21.01.2013 09:26 schrieb Sven Strickroth:\n> - The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n>   (starting with 1.8.0) in order to make clear that this one has special\n>   support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n>   version.\n> - The tortoisemerge mergetool does not work with filenames which have\n>   a space in it. Fixing this required changes in git and also in\n>   TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n> \n> The new tortoisegitmerge helper was added so that people can still use\n> TortoiseMerge from TortoiseSVN (and older TortoiseGit versions).\n\nAny comments for this patch?\n\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207705","messageId":"7vfw1qbbr4.fsf@alter.siamese.dyndns.org","threadId":"32675","inReplyTo":"50FCFBBB.2080305@tu-clausthal.de","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-24T19:51:27Z","receivedAt":"2013-01-24T19:51:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n\n> - The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n>   (starting with 1.8.0) in order to make clear that this one has special\n>   support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n>   version.\n\nWouldn't it make more sense in such a situation if your users can\nkeep using the old \"tortoisemerge\" configured in their configuration\nand when the renamed one is found the mergetool automatically used\nit, rather than the way your patch is done?  It seems that you are\nforcing all the users to reconfigure or retrain their fingers.  Is\nthat the best we can do?  Is it too cumbersome to autodetect the\npresense of tortoisegitmerge and redirect a request for tortoisemerge\nto it, perhaps using translate_merge_tool_path (cf. mergetools/bc3)?\n\nAssuming that people that have both variants will always want\nmergetool to use tortoisegitmerge, that is.  If there are some\nfeatures missing from or extra bugs in tortoisegitmerge that makes\nsome people favor tortoisemerge, then giving two choices like your\npatch does may make more sense.  I only know the difference between\nthe two from your four-line description above, but it does not look\nlike it is the case.\n\n> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n> index 4314ad0..13cbe5b 100644\n> --- a/Documentation/diff-config.txt\n> +++ b/Documentation/diff-config.txt\n> @@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::\n>  diff.tool::\n>  \tThe diff tool to be used by linkgit:git-difftool[1].  This\n>  \toption overrides `merge.tool`, and has the same valid built-in\n> -\tvalues as `merge.tool` minus \"tortoisemerge\" and plus\n> -\t\"kompare\".  Any other value is treated as a custom diff tool,\n> +\tvalues as `merge.tool` minus \"tortoisemerge\"/\"tortoisegitmerge\" and\n> +\tplus \"kompare\".  Any other value is treated as a custom diff tool,\n>  \tand there must be a corresponding `difftool.<tool>.cmd`\n>  \toption.\n\nSo in short, two tortoises and kompare are only valid as mergetool\nbut cannot be used as difftool?  No, I am reading it wrong.\nmerge.tool can be used for both, kompare can be used as difftool,\nand two tortoises can only be used as mergetool.\n\nThis paragraph needs to be rewritten to unconfuse readers.  The\noriginal is barely intelligible, and it becomes unreadable as the\nset of tools subtracted by \"minus\" and added by \"plus\" grows.\n"},{"id":"207726","messageId":"5101B0A5.1020308@tu-clausthal.de","threadId":"32675","inReplyTo":"7vfw1qbbr4.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-24T22:07:33Z","receivedAt":"2013-01-24T22:07:33Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"Am 24.01.2013 20:51 schrieb Junio C Hamano:\n> Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n> \n>> - The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n>>   (starting with 1.8.0) in order to make clear that this one has special\n>>   support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n>>   version.\n> \n> Wouldn't it make more sense in such a situation if your users can\n> keep using the old \"tortoisemerge\" configured in their configuration\n> and when the renamed one is found the mergetool automatically used\n> it, rather than the way your patch is done?\n\nThat was also my first idea, however, TortoiseMerge uses parameters as\nfollows: '-base:\"$BASE\"'. TortoiseGitMerge uses values separated by\nspace from keys: '-base \"$BASE\"'. So both are incompatible (the first\napproach has problems with spaces in filenames, the TortoiseGitMerge\napproach fixes this).\n\n>> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n>> index 4314ad0..13cbe5b 100644\n>> --- a/Documentation/diff-config.txt\n>> +++ b/Documentation/diff-config.txt\n>> @@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::\n>>  diff.tool::\n>>  \tThe diff tool to be used by linkgit:git-difftool[1].  This\n>>  \toption overrides `merge.tool`, and has the same valid built-in\n>> -\tvalues as `merge.tool` minus \"tortoisemerge\" and plus\n>> -\t\"kompare\".  Any other value is treated as a custom diff tool,\n>> +\tvalues as `merge.tool` minus \"tortoisemerge\"/\"tortoisegitmerge\" and\n>> +\tplus \"kompare\".  Any other value is treated as a custom diff tool,\n>>  \tand there must be a corresponding `difftool.<tool>.cmd`\n>>  \toption.\n> \n> So in short, two tortoises and kompare are only valid as mergetool\n> but cannot be used as difftool?  No, I am reading it wrong.\n> merge.tool can be used for both, kompare can be used as difftool,\n> and two tortoises can only be used as mergetool.\n> \n> This paragraph needs to be rewritten to unconfuse readers.  The\n> original is barely intelligible, and it becomes unreadable as the\n> set of tools subtracted by \"minus\" and added by \"plus\" grows.\n\nBut I think this should not be part of this patch.\n\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207727","messageId":"7vpq0u8bxd.fsf@alter.siamese.dyndns.org","threadId":"32675","inReplyTo":"5101B0A5.1020308@tu-clausthal.de","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-24T22:15:58Z","receivedAt":"2013-01-24T22:15:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n\n> Am 24.01.2013 20:51 schrieb Junio C Hamano:\n>> Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n>> \n>>> - The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n>>>   (starting with 1.8.0) in order to make clear that this one has special\n>>>   support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n>>>   version.\n>> \n>> Wouldn't it make more sense in such a situation if your users can\n>> keep using the old \"tortoisemerge\" configured in their configuration\n>> and when the renamed one is found the mergetool automatically used\n>> it, rather than the way your patch is done?\n>\n> That was also my first idea, however, TortoiseMerge uses parameters as\n> follows: '-base:\"$BASE\"'. TortoiseGitMerge uses values separated by\n> space from keys: '-base \"$BASE\"'. So both are incompatible (the first\n> approach has problems with spaces in filenames, the TortoiseGitMerge\n> approach fixes this).\n\nOK.  Please unconfuse future readers of \"git log\" by saying why such\na unification does not work in the proposed log message.\n\n>>> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n>>> index 4314ad0..13cbe5b 100644\n>>> --- a/Documentation/diff-config.txt\n>>> +++ b/Documentation/diff-config.txt\n>>> @@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::\n>>>  diff.tool::\n>>>  \tThe diff tool to be used by linkgit:git-difftool[1].  This\n>>>  \toption overrides `merge.tool`, and has the same valid built-in\n>>> -\tvalues as `merge.tool` minus \"tortoisemerge\" and plus\n>>> -\t\"kompare\".  Any other value is treated as a custom diff tool,\n>>> +\tvalues as `merge.tool` minus \"tortoisemerge\"/\"tortoisegitmerge\" and\n>>> +\tplus \"kompare\".  Any other value is treated as a custom diff tool,\n>>>  \tand there must be a corresponding `difftool.<tool>.cmd`\n>>>  \toption.\n>> \n>> So in short, two tortoises and kompare are only valid as mergetool\n>> but cannot be used as difftool?  No, I am reading it wrong.\n>> merge.tool can be used for both, kompare can be used as difftool,\n>> and two tortoises can only be used as mergetool.\n>> \n>> This paragraph needs to be rewritten to unconfuse readers.  The\n>> original is barely intelligible, and it becomes unreadable as the\n>> set of tools subtracted by \"minus\" and added by \"plus\" grows.\n>\n> But I think this should not be part of this patch.\n\nI agree that it can be done (and it is better to be done) as a\npreparatory step.  The current text is barely readable, but with\nthis patch there will be two \"minus\", and the result becomes\nunreadable at that point.\n\nIt also could be done as a follow-up documentation readability fix.\n"},{"id":"207765","messageId":"CAJDDKr5O70tTfwuipWcYVJL6gM3bUyQh-22yVO89xn8OFsQOpw@mail.gmail.com","threadId":"32675","inReplyTo":"7vpq0u8bxd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-01-25T06:11:45Z","receivedAt":"2013-01-25T06:11:45Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Thu, Jan 24, 2013 at 2:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n>\n>> Am 24.01.2013 20:51 schrieb Junio C Hamano:\n>>> Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n>>>\n>>>> - The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n>>>>   (starting with 1.8.0) in order to make clear that this one has special\n>>>>   support for git and prevent confusion with the TortoiseSVN TortoiseMerge\n>>>>   version.\n>>>\n>>> Wouldn't it make more sense in such a situation if your users can\n>>> keep using the old \"tortoisemerge\" configured in their configuration\n>>> and when the renamed one is found the mergetool automatically used\n>>> it, rather than the way your patch is done?\n>>\n>> That was also my first idea, however, TortoiseMerge uses parameters as\n>> follows: '-base:\"$BASE\"'. TortoiseGitMerge uses values separated by\n>> space from keys: '-base \"$BASE\"'. So both are incompatible (the first\n>> approach has problems with spaces in filenames, the TortoiseGitMerge\n>> approach fixes this).\n>\n> OK.  Please unconfuse future readers of \"git log\" by saying why such\n> a unification does not work in the proposed log message.\n\nEven though the old tortoisemerge and the new tortoisegitmerge\nhave completely different syntax, could we still use the existence\nof one when deciding which syntax to use?\n\npseudo-code at the top of the scriptlet:\n\nif test -z \"$tortoisegitmerge\"\nthen\n    if type tortoisegitmerge 2>&1 >/dev/null\n    then\n        tortoisegitmerge=true\n    else\n        tortoisegitmerge=false\n    fi\nfi\n\n...and then later merge_cmd and diff_cmd\ncan delegate to {diff,merge}_cmd_legacy() and\n{diff,merge}_cmd_gitmerge() functions to do the work.\n\nIt's just a thought.  translate_merge_tool_path()\nis too low-level to do it, but it seems like we could\nget away with it by having some extra smarts in the\nscriptlet.\n\n>>>> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n>>>> index 4314ad0..13cbe5b 100644\n>>>> --- a/Documentation/diff-config.txt\n>>>> +++ b/Documentation/diff-config.txt\n>>>> @@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::\n>>>>  diff.tool::\n>>>>     The diff tool to be used by linkgit:git-difftool[1].  This\n>>>>     option overrides `merge.tool`, and has the same valid built-in\n>>>> -   values as `merge.tool` minus \"tortoisemerge\" and plus\n>>>> -   \"kompare\".  Any other value is treated as a custom diff tool,\n>>>> +   values as `merge.tool` minus \"tortoisemerge\"/\"tortoisegitmerge\" and\n>>>> +   plus \"kompare\".  Any other value is treated as a custom diff tool,\n>>>>     and there must be a corresponding `difftool.<tool>.cmd`\n>>>>     option.\n>>>\n>>> So in short, two tortoises and kompare are only valid as mergetool\n>>> but cannot be used as difftool?  No, I am reading it wrong.\n>>> merge.tool can be used for both, kompare can be used as difftool,\n>>> and two tortoises can only be used as mergetool.\n>>>\n>>> This paragraph needs to be rewritten to unconfuse readers.  The\n>>> original is barely intelligible, and it becomes unreadable as the\n>>> set of tools subtracted by \"minus\" and added by \"plus\" grows.\n>>\n>> But I think this should not be part of this patch.\n>\n> I agree that it can be done (and it is better to be done) as a\n> preparatory step.  The current text is barely readable, but with\n> this patch there will be two \"minus\", and the result becomes\n> unreadable at that point.\n>\n> It also could be done as a follow-up documentation readability fix.\n\nAnother thought would be to minimize this section as much\nas possible and point users to \"git difftool --tool-help\".\n\nWe can then improve --tool-help (there are already preliminary\npatches in-flight to do so) so that we do not have to maintain\nthis documentation in the future.\n\nLikewise, if we are able to teach the scriptlet to choose\nthe best one (and not require a new scriptlet) then this\nsection could be left as-is for this patch.\n-- \nDavid\n"},{"id":"207766","messageId":"7vvcal683y.fsf@alter.siamese.dyndns.org","threadId":"32675","inReplyTo":"CAJDDKr5O70tTfwuipWcYVJL6gM3bUyQh-22yVO89xn8OFsQOpw@mail.gmail.com","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-25T07:21:21Z","receivedAt":"2013-01-25T07:21:21Z","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> Even though the old tortoisemerge and the new tortoisegitmerge\n> have completely different syntax, could we still use the existence\n> of one when deciding which syntax to use?\n> ...\n> ...and then later merge_cmd and diff_cmd\n> can delegate to {diff,merge}_cmd_legacy() and\n> {diff,merge}_cmd_gitmerge() functions to do the work.\n>\n> It's just a thought.  translate_merge_tool_path()\n> is too low-level to do it, but it seems like we could\n> get away with it by having some extra smarts in the\n> scriptlet.\n\nSounds like a far better approach to me.  I'd like to at least see\nan attempt be made to make that work first.\n\n>>>> This paragraph needs to be rewritten to unconfuse readers.  The\n>>>> original is barely intelligible, and it becomes unreadable as the\n>>>> set of tools subtracted by \"minus\" and added by \"plus\" grows.\n>>>\n>>> But I think this should not be part of this patch.\n>>\n>> I agree that it can be done (and it is better to be done) as a\n>> preparatory step.  The current text is barely readable, but with\n>> this patch there will be two \"minus\", and the result becomes\n>> unreadable at that point.\n>>\n>> It also could be done as a follow-up documentation readability fix.\n>\n> Another thought would be to minimize this section as much\n> as possible and point users to \"git difftool --tool-help\".\n\nWe had a similar discussion here:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/201913/focus=201976\n\nand Documentation/git-{diff,merge}tool.txt have stayed quiet since\nthen.\n\nBut Documentation/merge-config.txt tries to list everything that _could_\nbe enabled, and I do not necessarily think having one single\nlocation that lists everything is such a bad idea.\n\nIs there a way for me to programatically tell what merge.tool and\ndiff.tool could be enabled for a particular source checkout of Git\nregardless of what platform am I on (that is, even though I won't\ntouch Windows, I want to see 'tortoise' appear in the output of such\na procedure)?  We could generate a small text file from the Makefile\nin Documentation and include it when building the manual pages if\nsuch a procedure is available.\n"},{"id":"207769","messageId":"CAJDDKr4oerSq16rYt2iKNtQNK79L+jOiKROhEW_yiBPKjkVhuQ@mail.gmail.com","threadId":"32675","inReplyTo":"7vvcal683y.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-01-25T07:54:25Z","receivedAt":"2013-01-25T07:54:25Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Thu, Jan 24, 2013 at 11:21 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> David Aguilar <davvid@gmail.com> writes:\n>>>>> This paragraph needs to be rewritten to unconfuse readers.  The\n>>>>> original is barely intelligible, and it becomes unreadable as the\n>>>>> set of tools subtracted by \"minus\" and added by \"plus\" grows.\n>>>>\n>>>> But I think this should not be part of this patch.\n>>>\n>>> I agree that it can be done (and it is better to be done) as a\n>>> preparatory step.  The current text is barely readable, but with\n>>> this patch there will be two \"minus\", and the result becomes\n>>> unreadable at that point.\n>>>\n>>> It also could be done as a follow-up documentation readability fix.\n>>\n>> Another thought would be to minimize this section as much\n>> as possible and point users to \"git difftool --tool-help\".\n>\n> We had a similar discussion here:\n>\n>   http://thread.gmane.org/gmane.comp.version-control.git/201913/focus=201976\n>\n> and Documentation/git-{diff,merge}tool.txt have stayed quiet since\n> then.\n>\n> But Documentation/merge-config.txt tries to list everything that _could_\n> be enabled, and I do not necessarily think having one single\n> location that lists everything is such a bad idea.\n>\n> Is there a way for me to programatically tell what merge.tool and\n> diff.tool could be enabled for a particular source checkout of Git\n> regardless of what platform am I on (that is, even though I won't\n> touch Windows, I want to see 'tortoise' appear in the output of such\n> a procedure)?  We could generate a small text file from the Makefile\n> in Documentation and include it when building the manual pages if\n> such a procedure is available.\n\nThat's a good idea.\nHere's one way... (typed into gmail, so probably broken)\n\nLF='\n'\nmergetools=\ndifftools=\nscriptlets=\"$(git --exec-path)\"/mergetools\n\nfor script in \"$scriptlets\"/*\ndo\n    tool=\"$(basename \"$script\")\"\n    if test \"$tool\" = \"defaults\"\n    then\n        continue\n    fi\n    . \"$scriptlets\"/defaults\n    can_diff && difftools=\"$difftools$tool$LF\"\n    can_merge && mergetools=\"$mergetools$tool$LF\"\ndone\n\nI can follow up with a Documentation patch along these lines.\nI'm would imagine it would be hooked up similarly to how the\ncommand lists are constructed.\n\nThis should allow the tortoisemerge improvements to happen independently.\n-- \nDavid\n"},{"id":"207777","messageId":"51024B02.9020400@tu-clausthal.de","threadId":"32675","inReplyTo":"5101B0A5.1020308@tu-clausthal.de","subject":"[PATCH] mergetools: Enhance tortoisemerge to work with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-25T09:06:10Z","receivedAt":"2013-01-25T09:06:10Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"TortoiseGitMerge and filenames with spaces\n\n- The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n  (starting with 1.8.0) in order to make clear that this one has special\n  support for git, (uses spaces as cli parameter key-value separators)\n  and prevent confusion with the TortoiseSVN TortoiseMerge version.\n- The tortoisemerge mergetool does not work with filenames which have\n  a space in it. Fixing this required changes in git and also in\n  TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\nReported-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n mergetools/tortoisemerge | 24 ++++++++++++++++++++----\n 1 file changed, 20 insertions(+), 4 deletions(-)\n\ndiff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\nindex ed7db49..9890737 100644\n--- a/mergetools/tortoisemerge\n+++ b/mergetools/tortoisemerge\n@@ -6,12 +6,28 @@ merge_cmd () {\n \tif $base_present\n \tthen\n \t\ttouch \"$BACKUP\"\n-\t\t\"$merge_tool_path\" \\\n-\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n-\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tif test \"$merge_tool_path\" == \"tortoisegitmerge\"\n+\t\tthen\n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n+\t\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n+\t\telse \n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n+\t\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tfi\n \t\tcheck_unchanged\n \telse\n-\t\techo \"TortoiseMerge cannot be used without a base\" 1>&2\n+\t\techo \"$merge_tool_path cannot be used without a base\" 1>&2\n \t\treturn 1\n \tfi\n }\n+\n+translate_merge_tool_path() {\n+\tif type tortoisegitmerge >/dev/null 2>/dev/null\n+\tthen\n+\t\techo tortoisegitmerge\n+\telse\n+\t\techo tortoisemerge\n+\tfi\n+}\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207791","messageId":"20130125094823.GW7498@serenity.lan","threadId":"32675","inReplyTo":"CAJDDKr4oerSq16rYt2iKNtQNK79L+jOiKROhEW_yiBPKjkVhuQ@mail.gmail.com","subject":"Re: [PATCH] mergetools: Add tortoisegitmerge helper","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-01-25T09:48:23Z","receivedAt":"2013-01-25T09:48:23Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Thu, Jan 24, 2013 at 11:54:25PM -0800, David Aguilar wrote:\n> On Thu, Jan 24, 2013 at 11:21 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> > Is there a way for me to programatically tell what merge.tool and\n> > diff.tool could be enabled for a particular source checkout of Git\n> > regardless of what platform am I on (that is, even though I won't\n> > touch Windows, I want to see 'tortoise' appear in the output of such\n> > a procedure)?  We could generate a small text file from the Makefile\n> > in Documentation and include it when building the manual pages if\n> > such a procedure is available.\n> \n> That's a good idea.\n> Here's one way... (typed into gmail, so probably broken)\n>\n> LF='\n> '\n> mergetools=\n> difftools=\n> scriptlets=\"$(git --exec-path)\"/mergetools\n> \n> for script in \"$scriptlets\"/*\n> do\n>     tool=\"$(basename \"$script\")\"\n>     if test \"$tool\" = \"defaults\"\n>     then\n>         continue\n>     fi\n>     . \"$scriptlets\"/defaults\n>     can_diff && difftools=\"$difftools$tool$LF\"\n>     can_merge && mergetools=\"$mergetools$tool$LF\"\n> done\n\nI don't think this will work since the names of the valid tools are not\nnecessarily the same as the names of the scriptlets - this is the exact\nissue that prompted my patches to git-difftool yesterday.\n\nThe best option I can see given what's currently available is something\nlike this:\n\n-- >8 --\n\nsed -n -e '/^list_merge_tool_candidates/,/^}/ {\n        /tools=/ {\n                s/.*tools=//\n                s/\"//g\n                s/\\$tools//\n                s/ /\\n/g\n                p\n        }\n}' git-mergetool--lib.sh |sort |uniq |while read -r tool\ndo\n\ttest -z \"$tool\" && continue\n\t( . git-mergetool--lib && setup_tool $tool\n        \t# Use can_diff and can_merge here.\n\t)\ndone\n\n-- 8< --\n\n\nJohn\n"},{"id":"207793","messageId":"CAJDDKr7eNyJp1ffBYEJaZkmnVWqd0AMpnm1kdjnrrhPtuGNL_w@mail.gmail.com","threadId":"32675","inReplyTo":"51024B02.9020400@tu-clausthal.de","subject":"Re: [PATCH] mergetools: Enhance tortoisemerge to work with","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-01-25T10:09:45Z","receivedAt":"2013-01-25T10:09:45Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Jan 25, 2013 at 1:06 AM, Sven Strickroth\n<sven.strickroth@tu-clausthal.de> wrote:\n> TortoiseGitMerge and filenames with spaces\n>\n> - The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n>   (starting with 1.8.0) in order to make clear that this one has special\n>   support for git, (uses spaces as cli parameter key-value separators)\n>   and prevent confusion with the TortoiseSVN TortoiseMerge version.\n> - The tortoisemerge mergetool does not work with filenames which have\n>   a space in it. Fixing this required changes in git and also in\n>   TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n>\n> Signed-off-by: Sven Strickroth <email@cs-ware.de>\n> Reported-by: Sebastian Schuberth <sschuberth@gmail.com>\n> ---\n>  mergetools/tortoisemerge | 24 ++++++++++++++++++++----\n>  1 file changed, 20 insertions(+), 4 deletions(-)\n>\n> diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\n> index ed7db49..9890737 100644\n> --- a/mergetools/tortoisemerge\n> +++ b/mergetools/tortoisemerge\n> @@ -6,12 +6,28 @@ merge_cmd () {\n>         if $base_present\n>         then\n>                 touch \"$BACKUP\"\n> -               \"$merge_tool_path\" \\\n> -                       -base:\"$BASE\" -mine:\"$LOCAL\" \\\n> -                       -theirs:\"$REMOTE\" -merged:\"$MERGED\"\n> +               if test \"$merge_tool_path\" == \"tortoisegitmerge\"\n\nI like the approach this is taking.  Thank you.\nI have one small note:\n\nI think this should use \"=\" instead of \"==\" here.\n\nIt might also make sense to wrap a basename call around it\nso that users can set their own mergetool.tortoisemerge.path\n\nbasename=\"$(basename \"$merge_tool_path\" .exe)\"\nif test \"$basename\" = \"tortoisegitmerge\"\n...\n\n\n> +               then\n> +                       \"$merge_tool_path\" \\\n> +                               -base \"$BASE\" -mine \"$LOCAL\" \\\n> +                               -theirs \"$REMOTE\" -merged \"$MERGED\"\n> +               else\n> +                       \"$merge_tool_path\" \\\n> +                               -base:\"$BASE\" -mine:\"$LOCAL\" \\\n> +                               -theirs:\"$REMOTE\" -merged:\"$MERGED\"\n> +               fi\n>                 check_unchanged\n>         else\n> -               echo \"TortoiseMerge cannot be used without a base\" 1>&2\n> +               echo \"$merge_tool_path cannot be used without a base\" 1>&2\n>                 return 1\n>         fi\n>  }\n> +\n> +translate_merge_tool_path() {\n> +       if type tortoisegitmerge >/dev/null 2>/dev/null\n> +       then\n> +               echo tortoisegitmerge\n> +       else\n> +               echo tortoisemerge\n> +       fi\n> +}\n> --\n> Best regards,\n>  Sven Strickroth\n>  PGP key id F5A9D4C4 @ any key-server\n-- \nDavid\n"},{"id":"207807","messageId":"5102837C.9000608@tu-clausthal.de","threadId":"32675","inReplyTo":"CAJDDKr7eNyJp1ffBYEJaZkmnVWqd0AMpnm1kdjnrrhPtuGNL_w@mail.gmail.com","subject":"[PATCH] mergetools: Enhance tortoisemerge to work with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-25T13:07:08Z","receivedAt":"2013-01-25T13:07:08Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":" TortoiseGitMerge and filenames with spaces\n\n- The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n  (starting with 1.8.0) in order to make clear that this one has special\n  support for git, (uses spaces as cli parameter key-value separators)\n  and prevent confusion with the TortoiseSVN TortoiseMerge version.\n- The tortoisemerge mergetool does not work with filenames which have\n  a space in it. Fixing this required changes in git and also in\n  TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\nReported-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n mergetools/tortoisemerge | 51 ++++++++++++++++++++++++++++++++----------------\n 1 file changed, 34 insertions(+), 17 deletions(-)\n\ndiff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\nindex ed7db49..8ee99a5 100644\n--- a/mergetools/tortoisemerge\n+++ b/mergetools/tortoisemerge\n@@ -1,17 +1,34 @@\n-can_diff () {\n-\treturn 1\n-}\n-\n-merge_cmd () {\n-\tif $base_present\n-\tthen\n-\t\ttouch \"$BACKUP\"\n-\t\t\"$merge_tool_path\" \\\n-\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n-\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n-\t\tcheck_unchanged\n-\telse\n-\t\techo \"TortoiseMerge cannot be used without a base\" 1>&2\n-\t\treturn 1\n-\tfi\n-}\n+can_diff () {\n+\treturn 1\n+}\n+\n+merge_cmd () {\n+\tif $base_present\n+\tthen\n+\t\ttouch \"$BACKUP\"\n+\t\tbasename=\"$(basename \"$merge_tool_path\" .exe)\"\n+\t\tif test \"$basename\" = \"tortoisegitmerge\"\n+\t\tthen\n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n+\t\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n+\t\telse \n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n+\t\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tfi\n+\t\tcheck_unchanged\n+\telse\n+\t\techo \"$merge_tool_path cannot be used without a base\" 1>&2\n+\t\treturn 1\n+\tfi\n+}\n+\n+translate_merge_tool_path() {\n+\tif type tortoisegitmerge >/dev/null 2>/dev/null\n+\tthen\n+\t\techo tortoisegitmerge\n+\telse\n+\t\techo tortoisemerge\n+\tfi\n+}\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207821","messageId":"7v622l5d87.fsf@alter.siamese.dyndns.org","threadId":"32675","inReplyTo":"5102837C.9000608@tu-clausthal.de","subject":"Re: [PATCH] mergetools: Enhance tortoisemerge to work with","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-25T18:28:24Z","receivedAt":"2013-01-25T18:28:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n\n>  TortoiseGitMerge and filenames with spaces\n\n??? ECANNOTPARSE.\n\n... ah, wait.  Is this a broken-off tail of your subject line?\n\nIt may be a sign that you are doing too many unrelated things in a\nsingle patch when your subject does not fit on a single line.\n\nPerhaps this is better done as a two-patch series?\n\n * mergetools: fix tortoisemerge support for pathnames with SP\n * mergetools: support tortoisegitmerge\n\n>  mergetools/tortoisemerge | 51 ++++++++++++++++++++++++++++++++----------------\n>  1 file changed, 34 insertions(+), 17 deletions(-)\n>\n> diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\n> index ed7db49..8ee99a5 100644\n> --- a/mergetools/tortoisemerge\n> +++ b/mergetools/tortoisemerge\n> @@ -1,17 +1,34 @@\n> -can_diff () {\n> -\treturn 1\n> -}\n> -\n> -merge_cmd () {\n> -\tif $base_present\n> -\tthen\n> -\t\ttouch \"$BACKUP\"\n> -\t\t\"$merge_tool_path\" \\\n> -\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n> -\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n> -\t\tcheck_unchanged\n> -\telse\n> -\t\techo \"TortoiseMerge cannot be used without a base\" 1>&2\n> -\t\treturn 1\n> -\tfi\n> -}\n> +can_diff () {\n> +\treturn 1\n> +}\n> +\n> +merge_cmd () {\n> +\tif $base_present\n> +\tthen\n> +\t\ttouch \"$BACKUP\"\n> +\t\tbasename=\"$(basename \"$merge_tool_path\" .exe)\"\n> +\t\tif test \"$basename\" = \"tortoisegitmerge\"\n> +\t\tthen\n> +\t\t\t\"$merge_tool_path\" \\\n> +\t\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n> +\t\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n> +\t\telse \n> +\t\t\t\"$merge_tool_path\" \\\n> +\t\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n> +\t\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n\nHmph.\n\nHow was the support for \"names with spaces\" added in this new code?\nI do not spot what is different between this \"else\" clause and the\noriginal body of the merge_cmd (which only supported tortoisemerge).\n\nThey seem to be doing exactly the same thing.\n\n> +\t\tfi\n> +\t\tcheck_unchanged\n> +\telse\n> +\t\techo \"$merge_tool_path cannot be used without a base\" 1>&2\n> +\t\treturn 1\n> +\tfi\n> +}\n> +\n> +translate_merge_tool_path() {\n> +\tif type tortoisegitmerge >/dev/null 2>/dev/null\n> +\tthen\n> +\t\techo tortoisegitmerge\n> +\telse\n> +\t\techo tortoisemerge\n> +\tfi\n> +}\n"},{"id":"207860","messageId":"51032A45.1030308@tu-clausthal.de","threadId":"32675","inReplyTo":"7v622l5d87.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] mergetools: Enhance tortoisemerge to work with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-26T00:58:45Z","receivedAt":"2013-01-26T00:58:45Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"Am 25.01.2013 19:28 schrieb Junio C Hamano:> Sven Strickroth\n<sven.strickroth@tu-clausthal.de> writes:\n>\n>>  TortoiseGitMerge and filenames with spaces\n>\n> ??? ECANNOTPARSE.\n>\n> ... ah, wait.  Is this a broken-off tail of your subject line?\n\nYes.\n\n>> +\t\ttouch \"$BACKUP\"\n>> +\t\tbasename=\"$(basename \"$merge_tool_path\" .exe)\"\n>> +\t\tif test \"$basename\" = \"tortoisegitmerge\"\n>> +\t\tthen\n>> +\t\t\t\"$merge_tool_path\" \\\n>> +\t\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n>> +\t\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n>> +\t\telse\n>> +\t\t\t\"$merge_tool_path\" \\\n>> +\t\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n>> +\t\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n>\n> Hmph.\n>\n> How was the support for \"names with spaces\" added in this new code?\n> I do not spot what is different between this \"else\" clause and the\n> original body of the merge_cmd (which only supported tortoisemerge).\n>\n> They seem to be doing exactly the same thing.\n\nErhm, no. As already stated and also mentioned in the commit log:\nTortoiseMerge has cli parameter key-values separated by colons,\nTortoiseGitMerge has key-values separated by spaces.\n\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207862","messageId":"51032E01.8060200@tu-clausthal.de","threadId":"32675","inReplyTo":"7v622l5d87.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] mergetools: Enhance tortoisemerge to work with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-26T01:14:41Z","receivedAt":"2013-01-26T01:14:41Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n(starting with 1.8.0) in order to make clear that this one has special\nsupport for git and prevent confusion with the TortoiseSVN TortoiseMerge\nversion.\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\n---\n mergetools/tortoisemerge | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)\n\ndiff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\nindex ed7db49..8476afa 100644\n--- a/mergetools/tortoisemerge\n+++ b/mergetools/tortoisemerge\n@@ -11,7 +11,16 @@ merge_cmd () {\n \t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n \t\tcheck_unchanged\n \telse\n-\t\techo \"TortoiseMerge cannot be used without a base\" 1>&2\n+\t\techo \"$merge_tool_path cannot be used without a base\" 1>&2\n \t\treturn 1\n \tfi\n }\n+\n+translate_merge_tool_path() {\n+\tif type tortoisegitmerge >/dev/null 2>/dev/null\n+\tthen\n+\t\techo tortoisegitmerge\n+\telse\n+\t\techo tortoisemerge\n+\tfi\n+}\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207863","messageId":"51032E4D.7060705@tu-clausthal.de","threadId":"32675","inReplyTo":"7v622l5d87.fsf@alter.siamese.dyndns.org","subject":"[PATCH 1/2] mergetools: Added support for TortoiseGitMerge","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-26T01:15:57Z","receivedAt":"2013-01-26T01:15:57Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe\n(starting with 1.8.0) in order to make clear that this one has special\nsupport for git and prevent confusion with the TortoiseSVN TortoiseMerge\nversion.\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\n---\n mergetools/tortoisemerge | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)\n\ndiff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\nindex ed7db49..8476afa 100644\n--- a/mergetools/tortoisemerge\n+++ b/mergetools/tortoisemerge\n@@ -11,7 +11,16 @@ merge_cmd () {\n \t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n \t\tcheck_unchanged\n \telse\n-\t\techo \"TortoiseMerge cannot be used without a base\" 1>&2\n+\t\techo \"$merge_tool_path cannot be used without a base\" 1>&2\n \t\treturn 1\n \tfi\n }\n+\n+translate_merge_tool_path() {\n+\tif type tortoisegitmerge >/dev/null 2>/dev/null\n+\tthen\n+\t\techo tortoisegitmerge\n+\telse\n+\t\techo tortoisemerge\n+\tfi\n+}\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207864","messageId":"51032E96.2040209@tu-clausthal.de","threadId":"32675","inReplyTo":"7v622l5d87.fsf@alter.siamese.dyndns.org","subject":"[PATCH 2/2] mergetools: Make tortoisemerge work with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-26T01:17:10Z","receivedAt":"2013-01-26T01:17:10Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"tortoisegitmerge and filesnames with space\n\nThe tortoisemerge mergetool does not work with filenames which have\na space in it. Fixing this required changes in git and also in\nTortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.\n\nTortoiseGitMerge now separates cli parameter key-values by space instead\nof colons as TortoiseSVN TortoiseMerge does and supports filesnames\nwith spaces in it this way now.\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\nReported-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n mergetools/tortoisemerge | 14 +++++++++++---\n 1 file changed, 11 insertions(+), 3 deletions(-)\n\ndiff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\nindex 8476afa..2f98829 100644\n--- a/mergetools/tortoisemerge\n+++ b/mergetools/tortoisemerge\n@@ -6,9 +6,17 @@ merge_cmd () {\n \tif $base_present\n \tthen\n \t\ttouch \"$BACKUP\"\n-\t\t\"$merge_tool_path\" \\\n-\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n-\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tbasename=\"$(basename \"$merge_tool_path\" .exe)\"\n+\t\tif test \"$basename\" = \"tortoisegitmerge\"\n+\t\tthen\n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n+\t\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n+\t\telse \n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n+\t\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tfi\n \t\tcheck_unchanged\n \telse\n \t\techo \"$merge_tool_path cannot be used without a base\" 1>&2\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207869","messageId":"CAJDDKr6OhZOitTdDkHWnhVhdAis0U+95xUtaNn6nwkQ-k+bA+w@mail.gmail.com","threadId":"32675","inReplyTo":"51032E96.2040209@tu-clausthal.de","subject":"Re: [PATCH 2/2] mergetools: Make tortoisemerge work with","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-01-26T07:10:16Z","receivedAt":"2013-01-26T07:10:16Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Jan 25, 2013 at 5:17 PM, Sven Strickroth\n<sven.strickroth@tu-clausthal.de> wrote:\n> TortoiseGitMerge now separates cli parameter key-values by space instead\n> of colons as TortoiseSVN TortoiseMerge does and supports filesnames\n> with spaces in it this way now.\n\nThese patches look correct (I do not have the tool to test)\nbut I think we should fixup this commit message.\n\nHow about something like...\n\nmergetools: Teach tortoisemerge about TortoiseGitMerge\n\nTortoiseGitMerge improved its syntax to allow for file paths\nwith spaces.  Detect when it is installed and prefer it over\nTortoiseMerge.\n-- \nDavid\n"},{"id":"207942","messageId":"5104F009.5020606@tu-clausthal.de","threadId":"32675","inReplyTo":"CAJDDKr6OhZOitTdDkHWnhVhdAis0U+95xUtaNn6nwkQ-k+bA+w@mail.gmail.com","subject":"Re: [PATCH 2/2] mergetools: Make tortoisemerge work with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-01-27T09:14:49Z","receivedAt":"2013-01-27T09:14:49Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"Am 26.01.2013 08:10 schrieb David Aguilar:\n> These patches look correct (I do not have the tool to test)\n> but I think we should fixup this commit message.\n> \n> How about something like...\n> \n> mergetools: Teach tortoisemerge about TortoiseGitMerge\n> \n> TortoiseGitMerge improved its syntax to allow for file paths\n> with spaces.  Detect when it is installed and prefer it over\n> TortoiseMerge.\n\nThis message implies, that I have to combine two patches again?!\n\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"207964","messageId":"7vzjzuwm7s.fsf@alter.siamese.dyndns.org","threadId":"32675","inReplyTo":"5104F009.5020606@tu-clausthal.de","subject":"Re: [PATCH 2/2] mergetools: Make tortoisemerge work with","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-27T17:48:55Z","receivedAt":"2013-01-27T17:48:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:\n\n> Am 26.01.2013 08:10 schrieb David Aguilar:\n>> These patches look correct (I do not have the tool to test)\n>> but I think we should fixup this commit message.\n>> \n>> How about something like...\n>> \n>> mergetools: Teach tortoisemerge about TortoiseGitMerge\n>> \n>> TortoiseGitMerge improved its syntax to allow for file paths\n>> with spaces.  Detect when it is installed and prefer it over\n>> TortoiseMerge.\n>\n> This message implies, that I have to combine two patches again?!\n\nWe can see that [1/2] teaches mergetool to use tortoisegitmerge when\nthe user tells it to use tortoisemerge and the former is available.\n\nThe change in [2/2] is to use -base \"$BASE\" instead of -base:\"$BASE\"\nwhen the real tool is tortoisegitmerge (when it is tortoisemerge,\nnothing changes).\n\nBy reading these two patches, I would imagine that tortoisegitmerge\ncan accept both forms, i.e. -base:\"$BASE\" and -base \"$BASE\", but the\npatch [2/2] considers that the latter form is preferrable in some\nway.  As you talked about \"paths with SPs in them\", I would imagine\nthat is the difference?  That is -base:\"$BASE\" form will not work if\nthe varilable $BASE has a SP in it (even though it is encolosed in\ndq, which does not make much sense from my POSIXy point of view, but\nperhaps command line argument processing in the Windows land may\nhave different rules) but if you write -base \"$BASE\" then \"$BASE\"\nwill be taken as a single thing even it has a SP in it?  Also I\nwould guess that the reason why patch [2/2] does this only for\ntortoisegitmerge is either because tortoisemerge will break paths\nwith SPs even if it is given -base \"$BASE\" form, or because it only\naccepts -base:\"$BASE\" form? I cannot read it from your description,\nbut let's assume that is the reason.\n\nIf that is the case, then the log message for the second patch would\nbe easier to understand if it says so in a more explicit way,\nperhaps like this:\n\n\tTortoiseGitMerge, unlike TortoiseMerge, can be told to\n\thandle paths with SPs in them by using -option \"$FILE\" (not\n\t-option:\"$FILE\", which does not work for such paths) syntax.\n\n\tUse it to allow such paths to be handled correctly.\n\nBut I cannot read exactly why the patch [2/2] considers -base \"$BASE\"\nis preferrable over -base:\"$BASE\" from your original description, so\nthis may well be way off the mark.\n\nIn short, I think proposed log message for [2/2] was not clear what\nis being fixed and how.\n"},{"id":"208492","messageId":"510C1872.3090304@tu-clausthal.de","threadId":"32675","inReplyTo":"7vzjzuwm7s.fsf@alter.siamese.dyndns.org","subject":"[PATCH] mergetools: Enable tortoisemerge to handle filenames with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-02-01T19:33:06Z","receivedAt":"2013-02-01T19:33:06Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"spaces with TortoiseGitMerge\n\nTortoiseGitMerge, unlike TortoiseMerge, can be told to handle paths\nwith spaces in them by using -option \"$FILE\" (not -option:\"$FILE\",\nwhich does not work for such paths) syntax. Both do not have a fully\nposix compatible cli parameter parser, however, TortoiseGitMerge was\nmodified in order to handle filenames with spaces correctly. The\n\"-key value\" form was choosen because this way no escaping for\nquotes within quotes is necessary; see\nhttps://github.com/msysgit/msysgit/issues/57\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\nReported-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n mergetools/tortoisemerge | 14 +++++++++++---\n 1 file changed, 11 insertions(+), 3 deletions(-)\n\ndiff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\nindex 8476afa..3b89f1c 100644\n--- a/mergetools/tortoisemerge\n+++ b/mergetools/tortoisemerge\n@@ -6,9 +6,17 @@ merge_cmd () {\n \tif $base_present\n \tthen\n \t\ttouch \"$BACKUP\"\n-\t\t\"$merge_tool_path\" \\\n-\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n-\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tbasename=\"$(basename \"$merge_tool_path\" .exe)\"\n+\t\tif test \"$basename\" = \"tortoisegitmerge\"\n+\t\tthen\n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n+\t\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n+\t\telse\n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n+\t\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tfi\n \t\tcheck_unchanged\n \telse\n \t\techo \"$merge_tool_path cannot be used without a base\" 1>&2\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"208499","messageId":"CAHGBnuNpHtfnD6D+sji6e1yp2x6iLxjAbawwO6USF2iWW17nuQ@mail.gmail.com","threadId":"32675","inReplyTo":"510C1872.3090304@tu-clausthal.de","subject":"Re: [PATCH] mergetools: Enable tortoisemerge to handle filenames with","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2013-02-01T20:07:07Z","receivedAt":"2013-02-01T20:07:07Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Fri, Feb 1, 2013 at 8:33 PM, Sven Strickroth\n<sven.strickroth@tu-clausthal.de> wrote:\n\n> TortoiseGitMerge, unlike TortoiseMerge, can be told to handle paths\n> with spaces in them by using -option \"$FILE\" (not -option:\"$FILE\",\n> which does not work for such paths) syntax. Both do not have a fully\n> posix compatible cli parameter parser, however, TortoiseGitMerge was\n> modified in order to handle filenames with spaces correctly. The\n> \"-key value\" form was choosen because this way no escaping for\n> quotes within quotes is necessary; see\n> https://github.com/msysgit/msysgit/issues/57\n\nThe commit message still does not mention MSYS path mangling at all,\nwhich probably is why the reasoning of this patch was not yet fully\nunderstood. I'd recommend something like the following:\n\nmergetools: Teach tortoisemerge about TortoiseGitMerge\n\nTortoiseGitMerge is an improved version of TortoiseMerge specifically\nfor use with Git on Windows. Due to MSYS path mangling [1], the \":\"\nafter the \"base\" etc. arguments to TortoiseMerge caused to whole\nargument instead of just the file name to be quoted in case of file\nnames with spaces. So TortoiseMerge was passed\n\n    \"-base:new file.txt\"\n\ninstead of\n\n    -base:\"new file.txt\"\n\n(including the quotes). To work around this, TortoiseGitMerge does not\nrequire the \":\" after the arguments anymore which fixes handling file\nnames with spaces.\n\n[1] http://www.mingw.org/wiki/Posix_path_conversion\n\n-- \nSebastian Schuberth\n"},{"id":"208504","messageId":"510C2133.5070905@tu-clausthal.de","threadId":"32675","inReplyTo":"CAHGBnuNpHtfnD6D+sji6e1yp2x6iLxjAbawwO6USF2iWW17nuQ@mail.gmail.com","subject":"Re: [PATCH] mergetools: Enable tortoisemerge to handle filenames with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-02-01T20:10:27Z","receivedAt":"2013-02-01T20:10:27Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"Am 01.02.2013 21:07 schrieb Sebastian Schuberth:\n> mergetools: Teach tortoisemerge about TortoiseGitMerge\n\nThis subject doesn't make any sense if we don't combine the two patches.\n\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"208500","messageId":"7va9rnaiz4.fsf@alter.siamese.dyndns.org","threadId":"32675","inReplyTo":"CAHGBnuNpHtfnD6D+sji6e1yp2x6iLxjAbawwO6USF2iWW17nuQ@mail.gmail.com","subject":"Re: [PATCH] mergetools: Enable tortoisemerge to handle filenames with","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-01T20:15:43Z","receivedAt":"2013-02-01T20:15:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sebastian Schuberth <sschuberth@gmail.com> writes:\n\n> The commit message still does not mention MSYS path mangling at all,\n> which probably is why the reasoning of this patch was not yet fully\n> understood.\n\nAhh, you are very right.  I didn't realize that was what this funny\n\"with colon, with SP\" business was about.\n\n> I'd recommend something like the following:\n>\n> mergetools: Teach tortoisemerge about TortoiseGitMerge\n>\n> TortoiseGitMerge is an improved version of TortoiseMerge specifically\n> for use with Git on Windows. Due to MSYS path mangling [1], the \":\"\n> after the \"base\" etc. arguments to TortoiseMerge caused to whole\n> argument instead of just the file name to be quoted in case of file\n> names with spaces. So TortoiseMerge was passed\n>\n>     \"-base:new file.txt\"\n>\n> instead of\n>\n>     -base:\"new file.txt\"\n>\n> (including the quotes). To work around this, TortoiseGitMerge does not\n> require the \":\" after the arguments anymore which fixes handling file\n> names with spaces.\n>\n> [1] http://www.mingw.org/wiki/Posix_path_conversion\n\nSven?\n"},{"id":"208507","messageId":"510C229E.2050705@tu-clausthal.de","threadId":"32675","inReplyTo":"CAHGBnuNpHtfnD6D+sji6e1yp2x6iLxjAbawwO6USF2iWW17nuQ@mail.gmail.com","subject":"Re: [PATCH] mergetools: Enable tortoisemerge to handle filenames with spaces with TortoiseGitMerge","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-02-01T20:16:30Z","receivedAt":"2013-02-01T20:16:30Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"TortoiseGitMerge, unlike TortoiseMerge, can be told to handle paths\nwith spaces in them by using -option \"$FILE\" (not -option:\"$FILE\",\nwhich does not work for such paths) syntax.\n\nThis change was necessary because of MSYS path mangling [1], the \":\"\nafter the \"base\" etc. arguments to TortoiseMerge caused to whole\nargument instead of just the file name to be quoted in case of file\nnames with spaces. So TortoiseMerge was passed\n\n    \"-base:new file.txt\"\n\ninstead of\n\n    -base:\"new file.txt\"\n\n(including the quotes). To work around this, TortoiseGitMerge does not\nrequire the \":\" after the arguments anymore which fixes handling file\nnames with spaces [2] (as written above).\n\n[1] http://www.mingw.org/wiki/Posix_path_conversion\n[2] https://github.com/msysgit/msysgit/issues/57\n\nSigned-off-by: Sven Strickroth <email@cs-ware.de>\nReported-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n mergetools/tortoisemerge | 14 +++++++++++---\n 1 file changed, 11 insertions(+), 3 deletions(-)\n\ndiff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge\nindex 8476afa..3b89f1c 100644\n--- a/mergetools/tortoisemerge\n+++ b/mergetools/tortoisemerge\n@@ -6,9 +6,17 @@ merge_cmd () {\n \tif $base_present\n \tthen\n \t\ttouch \"$BACKUP\"\n-\t\t\"$merge_tool_path\" \\\n-\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n-\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tbasename=\"$(basename \"$merge_tool_path\" .exe)\"\n+\t\tif test \"$basename\" = \"tortoisegitmerge\"\n+\t\tthen\n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base \"$BASE\" -mine \"$LOCAL\" \\\n+\t\t\t\t-theirs \"$REMOTE\" -merged \"$MERGED\"\n+\t\telse\n+\t\t\t\"$merge_tool_path\" \\\n+\t\t\t\t-base:\"$BASE\" -mine:\"$LOCAL\" \\\n+\t\t\t\t-theirs:\"$REMOTE\" -merged:\"$MERGED\"\n+\t\tfi\n \t\tcheck_unchanged\n \telse\n \t\techo \"$merge_tool_path cannot be used without a base\" 1>&2\n-- \n1.8.1.msysgit.1\n"},{"id":"208505","messageId":"510C22E6.6010500@tu-clausthal.de","threadId":"32675","inReplyTo":"7va9rnaiz4.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] mergetools: Enable tortoisemerge to handle filenames with","fromName":"Sven Strickroth","fromEmail":"sven.strickroth@tu-clausthal.de","sentAt":"2013-02-01T20:17:42Z","receivedAt":"2013-02-01T20:17:42Z","isPatch":true,"sender":{"key":"sven.strickroth@tu-clausthal.de","avatar":null},"body":"Am 01.02.2013 21:15 schrieb Junio C Hamano:\n>> TortoiseGitMerge is an improved version of TortoiseMerge specifically\n>> for use with Git on Windows. Due to MSYS path mangling [1], the \":\"\n>> after the \"base\" etc. arguments to TortoiseMerge caused to whole\n>> argument instead of just the file name to be quoted in case of file\n>> names with spaces. So TortoiseMerge was passed\n>>\n>>     \"-base:new file.txt\"\n>>\n>> instead of\n>>\n>>     -base:\"new file.txt\"\n>>\n>> (including the quotes). To work around this, TortoiseGitMerge does not\n>> require the \":\" after the arguments anymore which fixes handling file\n>> names with spaces.\n>>\n>> [1] http://www.mingw.org/wiki/Posix_path_conversion\n> \n> Sven?\n\nI just mailed a new patch. Thanks to Sebastian for pointing this out!\n\n@Junio: Feel free to optimize the commit message.\n\n-- \nBest regards,\n Sven Strickroth\n PGP key id F5A9D4C4 @ any key-server\n"},{"id":"208517","messageId":"CAJDDKr4L3efzp6eBdTKQxXu8sfvyT91bK6MNh5OhXzWvms8TtQ@mail.gmail.com","threadId":"32675","inReplyTo":"510C229E.2050705@tu-clausthal.de","subject":"Re: [PATCH] mergetools: Enable tortoisemerge to handle filenames with spaces with TortoiseGitMerge","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-02-02T01:59:57Z","receivedAt":"2013-02-02T01:59:57Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Feb 1, 2013 at 12:16 PM, Sven Strickroth\n<sven.strickroth@tu-clausthal.de> wrote:\n> TortoiseMerge caused to whole\n> argument instead of just the file name to be quoted\n\ns/caused to whole/caused the whole/\n\nI think this commit message is very nice.  Is it too late to replace\nthe current patch with this one?\n-- \nDavid\n"},{"id":"208518","messageId":"7vehgz8o31.fsf@alter.siamese.dyndns.org","threadId":"32675","inReplyTo":"CAJDDKr4L3efzp6eBdTKQxXu8sfvyT91bK6MNh5OhXzWvms8TtQ@mail.gmail.com","subject":"Re: [PATCH] mergetools: Enable tortoisemerge to handle filenames with spaces with TortoiseGitMerge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-02T02:08:18Z","receivedAt":"2013-02-02T02:08:18Z","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> On Fri, Feb 1, 2013 at 12:16 PM, Sven Strickroth\n> <sven.strickroth@tu-clausthal.de> wrote:\n>> TortoiseMerge caused to whole\n>> argument instead of just the file name to be quoted\n>\n> s/caused to whole/caused the whole/\n>\n> I think this commit message is very nice.  Is it too late to replace\n> the current patch with this one?\n\nHaven't merged it to 'next'; I will replace with this, with a bit of\nretitling to make it shorter.\n\n\ncommit 81ed7b9581f7eafb334824264abb492d85a5ffb8\nAuthor: Sven Strickroth <sven.strickroth@tu-clausthal.de>\nDate:   Fri Feb 1 21:16:30 2013 +0100\n\n    mergetools: teach tortoisemerge to handle filenames with SP correctly\n    \n    TortoiseGitMerge, unlike TortoiseMerge, can be told to handle paths\n    with spaces in them by using -option \"$FILE\" (not -option:\"$FILE\",\n    which does not work for such paths) syntax.\n    \n    This change was necessary because of MSYS path mangling [1], the \":\"\n    after the \"base\" etc. arguments to TortoiseMerge caused the whole\n    argument instead of just the file name to be quoted in case of file\n    names with spaces. So TortoiseMerge was passed\n    \n        \"-base:new file.txt\"\n    \n    instead of\n    \n        -base:\"new file.txt\"\n    \n    (including the quotes). To work around this, TortoiseGitMerge does not\n    require the \":\" after the arguments anymore which fixes handling file\n    names with spaces [2] (as written above).\n    \n    [1] http://www.mingw.org/wiki/Posix_path_conversion\n    [2] https://github.com/msysgit/msysgit/issues/57\n    \n    Signed-off-by: Sven Strickroth <email@cs-ware.de>\n    Reported-by: Sebastian Schuberth <sschuberth@gmail.com>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n"}]}