[PATCH] mergetool--lib: add diffmerge as a pre-configured mergetool option

Subsystems: documentation, the rest

STALE3731d

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] mergetool--lib: add diffmerge as a pre-configured mergetool option

From: Jay Soffian <hidden>
Date: 2016-06-15 22:47:51

Add SourceGear DiffMerge to the set of built-in diff/merge tools, and update
bash completion and documentation.
---
 Documentation/git-difftool.txt         |    2 +-
 Documentation/git-mergetool.txt        |    2 +-
 Documentation/merge-config.txt         |    4 ++--
 contrib/completion/git-completion.bash |    2 +-
 git-mergetool--lib.sh                  |   22 ++++++++++++++++++++--
 5 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt
index 8e9aed6..28178da 100644
--- a/Documentation/git-difftool.txt
+++ b/Documentation/git-difftool.txt
@@ -31,7 +31,7 @@ OPTIONS
 	Use the diff tool specified by <tool>.
 	Valid merge tools are:
 	kdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,
-	ecmerge, diffuse, opendiff, p4merge and araxis.
+	ecmerge, diffuse, opendiff, p4merge, araxis and diffmerge.
 +
 If a diff tool is not specified, 'git-difftool'
 will use the configuration variable `diff.tool`.  If the
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index 4a6f7f3..7f00269 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -27,7 +27,7 @@ OPTIONS
 	Use the merge resolution program specified by <tool>.
 	Valid merge tools are:
 	kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,
-	diffuse, tortoisemerge, opendiff, p4merge and araxis.
+	diffuse, tortoisemerge, opendiff, p4merge, araxis and diffmerge.
 +
 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 a403155..a68a205 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -23,8 +23,8 @@ merge.tool::
 	Controls which merge resolution program is used by
 	linkgit:git-mergetool[1].  Valid built-in values are: "kdiff3",
 	"tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff",
-	"diffuse", "ecmerge", "tortoisemerge", "p4merge", "araxis" and
-	"opendiff".  Any other value is treated is custom merge tool
+	"diffuse", "ecmerge", "tortoisemerge", "p4merge", "araxis", "opendiff"
+	and "diffmerge".  Any other value is treated is custom merge tool
 	and there must be a corresponding mergetool.<tool>.cmd option.
 
 merge.verbosity::
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 7c18b0c..5cc5ee7 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -975,7 +975,7 @@ _git_diff ()
 }
 
 __git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
-			tkdiff vimdiff gvimdiff xxdiff araxis p4merge
+			tkdiff vimdiff gvimdiff xxdiff araxis p4merge diffmerge
 "
 
 _git_difftool ()
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 5b62785..5b29fef 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -46,7 +46,8 @@ check_unchanged () {
 valid_tool () {
 	case "$1" in
 	kdiff3 | tkdiff | xxdiff | meld | opendiff | \
-	emerge | vimdiff | gvimdiff | ecmerge | diffuse | araxis | p4merge)
+	emerge | vimdiff | gvimdiff | ecmerge | diffuse | araxis | p4merge | \
+	diffmerge)
 		;; # happy
 	tortoisemerge)
 		if ! merge_mode; then
@@ -297,6 +298,23 @@ run_merge_tool () {
 				>/dev/null 2>&1
 		fi
 		;;
+	diffmerge)
+		if merge_mode; then
+			if $base_present; then
+				"$merge_tool_path" -nosplash -merge -result="$MERGED" \
+					"$LOCAL" "$BASE" "$REMOTE"
+					>/dev/null 2>&1
+			else
+				"$merge_tool_path" -nosplash -merge \
+					"$LOCAL" "$MERGED" "$REMOTE"
+					>/dev/null 2>&1
+			fi
+			status=$?
+		else
+			"$merge_tool_path" -nosplash "$LOCAL" "$REMOTE" \
+				>/dev/null 2>&1
+		fi
+		;;
 	*)
 		merge_tool_cmd="$(get_merge_tool_cmd "$1")"
 		if test -z "$merge_tool_cmd"; then
@@ -336,7 +354,7 @@ guess_merge_tool () {
 		else
 			tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
 		fi
-		tools="$tools gvimdiff diffuse ecmerge p4merge araxis"
+		tools="$tools gvimdiff diffuse ecmerge p4merge araxis diffmerge"
 	fi
 	case "${VISUAL:-$EDITOR}" in
 	*vim*)
-- 
1.6.6.rc1.296.ge77fc.dirty

Re: [PATCH] mergetool--lib: add diffmerge as a pre-configured mergetool option

From: Charles Bailey <hidden>
Date: 2016-06-15 22:47:53

On Tue, Dec 08, 2009 at 12:01:17PM -0800, Jay Soffian wrote:
Add SourceGear DiffMerge to the set of built-in diff/merge tools, and update
bash completion and documentation.
---
 Documentation/git-difftool.txt         |    2 +-
 Documentation/git-mergetool.txt        |    2 +-
 Documentation/merge-config.txt         |    4 ++--
 contrib/completion/git-completion.bash |    2 +-
 git-mergetool--lib.sh                  |   22 ++++++++++++++++++++--
 5 files changed, 25 insertions(+), 7 deletions(-)
I'm not a diffmerge user but the patch looks fine to me.

Is diffmerge free but not Free?

Any reason for holding back on sign-off?

Charles.

Re: [PATCH] mergetool--lib: add diffmerge as a pre-configured mergetool option

From: Jay Soffian <hidden>
Date: 2016-06-15 22:47:53

On Wed, Dec 9, 2009 at 2:34 PM, Charles Bailey [off-list ref] wrote:
Is diffmerge free but not Free?
Correct, it's free as in beer, not as in speech. It is multi-platform
though (Linux, Windows, OS X). I've tested only on MacOS X. If someone
else wants to give it a test on Linux, that would be good. Looks like
there's both a deb and an rpm:

http://www.sourcegear.com/diffmerge/downloads.html
Any reason for holding back on sign-off?
Oversight:

Signed-off-by: Jay Soffian <redacted>

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help