git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mergetools: Add tortoisegitmerge helper
@ 2013-01-20 11:27 Sven Strickroth
  2013-01-21  0:43 ` Junio C Hamano
  0 siblings, 1 reply; 31+ messages in thread
From: Sven Strickroth @ 2013-01-20 11:27 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Sebastian Schuberth, davvid, Jeff King

- 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>
Reported-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 90f5f05..5332a33 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
+}
-- 
Best regards,
 Sven Strickroth
 PGP key id F5A9D4C4 @ any key-server

^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2013-02-02  2:08 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-20 11:27 [PATCH] mergetools: Add tortoisegitmerge helper Sven Strickroth
2013-01-21  0:43 ` Junio C Hamano
2013-01-21  8:24   ` Sven Strickroth
2013-01-21  8:26   ` Sven Strickroth
2013-01-24 11:19     ` Sven Strickroth
2013-01-24 19:51     ` Junio C Hamano
2013-01-24 22:07       ` Sven Strickroth
2013-01-24 22:15         ` Junio C Hamano
2013-01-25  6:11           ` David Aguilar
2013-01-25  7:21             ` Junio C Hamano
2013-01-25  7:54               ` David Aguilar
2013-01-25  9:48                 ` John Keeping
2013-01-25  9:06         ` [PATCH] mergetools: Enhance tortoisemerge to work with Sven Strickroth
2013-01-25 10:09           ` David Aguilar
2013-01-25 13:07             ` Sven Strickroth
2013-01-25 18:28               ` Junio C Hamano
2013-01-26  0:58                 ` Sven Strickroth
2013-01-26  1:14                 ` Sven Strickroth
2013-01-26  1:15                 ` [PATCH 1/2] mergetools: Added support for TortoiseGitMerge Sven Strickroth
2013-01-26  1:17                 ` [PATCH 2/2] mergetools: Make tortoisemerge work with Sven Strickroth
2013-01-26  7:10                   ` David Aguilar
2013-01-27  9:14                     ` Sven Strickroth
2013-01-27 17:48                       ` Junio C Hamano
2013-02-01 19:33                         ` [PATCH] mergetools: Enable tortoisemerge to handle filenames with Sven Strickroth
2013-02-01 20:07                           ` Sebastian Schuberth
2013-02-01 20:10                             ` Sven Strickroth
2013-02-01 20:15                             ` Junio C Hamano
2013-02-01 20:17                               ` Sven Strickroth
2013-02-01 20:16                             ` [PATCH] mergetools: Enable tortoisemerge to handle filenames with spaces with TortoiseGitMerge Sven Strickroth
2013-02-02  1:59                               ` David Aguilar
2013-02-02  2:08                                 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).