git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] mergetools: Add tortoisegitmerge helper

From
SSSven Strickroth <sven.strickroth@tu-clausthal.de>
Date
Jan 21, 2013, 08:24 UTC
Message-ID
<50FCFB37.2060708@tu-clausthal.de>
In-Reply-To
<7v4nibjrg0.fsf@alter.siamese.dyndns.org>
- The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe
  (starting with 1.8.0) in order to make clear that this one has special
  support for git and prevent confusion with the TortoiseSVN TortoiseMerge
  version.
- The tortoisemerge mergetool does not work with filenames which have
  a space in it. Fixing this required changes in git and also in
  TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.

The new tortoisegitmerge helper was added so that people can still use TortoiseMerge from TortoiseSVN (and older TortoiseGit versions).

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Idea-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 Documentation/diff-config.txt          |  4 ++--
 Documentation/git-mergetool.txt        |  4 ++--
 Documentation/merge-config.txt         |  6 +++---
 contrib/completion/git-completion.bash |  2 +-
 git-mergetool--lib.sh                  |  2 +-
 mergetools/tortoisegitmerge            | 17 +++++++++++++++++
 6 files changed, 26 insertions(+), 9 deletions(-)
 create mode 100644 mergetools/tortoisegitmerge
diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt
index 4314ad0..13cbe5b 100644
--- a/Documentation/diff-config.txt
+++ b/Documentation/diff-config.txt
@@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::
 diff.tool::
 	The diff tool to be used by linkgit:git-difftool[1].  This
 	option overrides `merge.tool`, and has the same valid built-in
-	values as `merge.tool` minus "tortoisemerge" and plus
-	"kompare".  Any other value is treated as a custom diff tool,
+	values as `merge.tool` minus "tortoisemerge"/"tortoisegitmerge" and
+	plus "kompare".  Any other value is treated as a custom diff tool,
 	and there must be a corresponding `difftool.<tool>.cmd`
 	option.
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index 6b563c5..a80cccd 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -28,8 +28,8 @@ OPTIONS
 --tool=<tool>::
 	Use the merge resolution program specified by <tool>.
 	Valid values include emerge, gvimdiff, kdiff3,
-	meld, vimdiff, and tortoisemerge. Run `git mergetool --tool-help`
-	for the list of valid <tool> settings.
+	meld, vimdiff, tortoisegitmerge, and tortoisemerge. Run
+	`git mergetool --tool-help` for the list of valid <tool> settings.
 +
 If a merge resolution program is not specified, 'git mergetool'
 will use the configuration variable `merge.tool`.  If the
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index 9bb4956..a047646 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -55,9 +55,9 @@ merge.tool::
 	Controls which merge resolution program is used by
 	linkgit:git-mergetool[1].  Valid built-in values are: "araxis",
 	"bc3", "diffuse", "ecmerge", "emerge", "gvimdiff", "kdiff3", "meld",
-	"opendiff", "p4merge", "tkdiff", "tortoisemerge", "vimdiff"
-	and "xxdiff".  Any other value is treated is custom merge tool
-	and there must be a corresponding mergetool.<tool>.cmd option.
+	"opendiff", "p4merge", "tkdiff", "tortoisegitmerge", "tortoisemerge",
+	"vimdiff" and "xxdiff".  Any other value is treated is custom merge
+	tool and there must be a corresponding mergetool.<tool>.cmd option.
 
 merge.verbosity::
 	Controls the amount of output shown by the recursive merge
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 14dd5e7..1557d54 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1345,7 +1345,7 @@ _git_mergetool ()
 {
 	case "$cur" in
 	--tool=*)
-		__gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}"
+		__gitcomp "$__git_mergetools_common tortoisegitmerge tortoisemerge" "" "${cur##--tool=}"
 		return
 		;;
 	--*)
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index f013a03..47183ef 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -150,7 +150,7 @@ run_merge_cmd () {
 list_merge_tool_candidates () {
 	if merge_mode
 	then
-		tools="tortoisemerge"
+		tools="tortoisegitmerge tortoisemerge"
 	else
 		tools="kompare"
 	fi
diff --git a/mergetools/tortoisegitmerge b/mergetools/tortoisegitmerge
new file mode 100644
index 0000000..5b802a7
--- /dev/null
+++ b/mergetools/tortoisegitmerge
@@ -0,0 +1,17 @@
+can_diff () {
+	return 1
+}
+
+merge_cmd () {
+	if $base_present
+	then
+		touch "$BACKUP"
+		"$merge_tool_path" \
+			-base="$BASE" -mine="$LOCAL" \
+			-theirs="$REMOTE" -merged="$MERGED"
+		check_unchanged
+	else
+		echo "TortoiseGitMerge cannot be used without a base" 1>&2
+		return 1
+	fi
+}
-- 
1.8.0.msysgit.0
Previous: Junio C HamanoNext: Sven Strickroth
Message 3 of 31 in “mergetools: Add tortoisegitmerge helper”
  1. mergetools: Add tortoisegitmerge helperSven Strickroth, Jan 20, 2013
  2. Junio C HamanoJan 21, 2013
  3. mergetools: Add tortoisegitmerge helperSven Strickroth, Jan 21, 2013
  4. mergetools: Add tortoisegitmerge helperSven Strickroth, Jan 21, 2013
  5. Sven StrickrothJan 24, 2013
  6. Junio C HamanoJan 24, 2013
  7. Sven StrickrothJan 24, 2013
  8. Junio C HamanoJan 24, 2013
  9. David AguilarJan 25, 2013
  10. Junio C HamanoJan 25, 2013
  11. David AguilarJan 25, 2013
  12. John KeepingJan 25, 2013
  13. mergetools: Enhance tortoisemerge to work withSven Strickroth, Jan 25, 2013
  14. David AguilarJan 25, 2013
  15. mergetools: Enhance tortoisemerge to work withSven Strickroth, Jan 25, 2013
  16. Junio C HamanoJan 25, 2013
  17. Sven StrickrothJan 26, 2013
  18. Sven StrickrothJan 26, 2013
  19. 1/2 mergetools: Added support for TortoiseGitMergeSven Strickroth, Jan 26, 2013
  20. 2/2 mergetools: Make tortoisemerge work withSven Strickroth, Jan 26, 2013
  21. David AguilarJan 26, 2013
  22. Sven StrickrothJan 27, 2013
  23. Junio C HamanoJan 27, 2013
  24. mergetools: Enable tortoisemerge to handle filenames withSven Strickroth, Feb 1, 2013
  25. Sebastian SchuberthFeb 1, 2013
  26. Sven StrickrothFeb 1, 2013
  27. Junio C HamanoFeb 1, 2013
  28. Sven StrickrothFeb 1, 2013
  29. Sven StrickrothFeb 1, 2013
  30. David AguilarFeb 2, 2013
  31. Junio C HamanoFeb 2, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.