git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Strickroth <sven.strickroth@tu-clausthal.de>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Sebastian Schuberth <sschuberth@gmail.com>,
	davvid@gmail.com, Jeff King <peff@peff.net>
Subject: [PATCH] mergetools: Add tortoisegitmerge helper
Date: Mon, 21 Jan 2013 09:24:23 +0100	[thread overview]
Message-ID: <50FCFB37.2060708@tu-clausthal.de> (raw)
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

  reply	other threads:[~2013-01-21  8:24 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50FCFB37.2060708@tu-clausthal.de \
    --to=sven.strickroth@tu-clausthal.de \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=sschuberth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).