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

[PATCH (GIT-GUI) 4/8] git-gui: Support more merge tools.

From
Alexander Gavrilov <angavrilov@gmail.com>
Date
Aug 30, 2008, 20:59 UTC
Message-ID
<200808310059.47327.angavrilov@gmail.com>
In-Reply-To
<200808310056.51324.angavrilov@gmail.com>
Add native support for Araxis Merge, WinMerge and Perforce merge.

Custom merge tools are not implemented by mergetool.tcl; besides, native support allows constructing the command lines in a more intelligent way.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
 lib/mergetool.tcl |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/lib/mergetool.tcl b/lib/mergetool.tcl
index ba9e8ce..5f3da1f 100644
--- a/lib/mergetool.tcl
+++ b/lib/mergetool.tcl
@@ -131,6 +131,7 @@ proc merge_resolve_tool2 {} {
 	if {$merge_tool_path eq {}} {
 		switch -- $tool {
 		emerge { set merge_tool_path "emacs" }
+		araxis { set merge_tool_path "compare" }
 		default { set merge_tool_path $tool }
 		}
 	}
@@ -210,6 +211,31 @@ proc merge_resolve_tool2 {} {
 					"$LOCAL" "$REMOTE" "$basename"]
 		}
 	}
+	winmerge {
+		if {$base_stage ne {}} {
+			# This tool does not support 3-way merges.
+			# Use the 'conflict file' resolution feature instead.
+			set cmdline [list "$merge_tool_path" -e -ub "$MERGED"]
+		} else {
+			set cmdline [list "$merge_tool_path" -e -ub -wl \
+				-dl "Theirs File" -dr "Mine File" "$REMOTE" "$LOCAL" "$MERGED"]
+		}
+	}
+	araxis {
+		if {$base_stage ne {}} {
+			set cmdline [list "$merge_tool_path" -wait -merge -3 -a1 \
+				-title1:"'$MERGED (Base)'" -title2:"'$MERGED (Local)'" \
+				-title3:"'$MERGED (Remote)'" \
+				"$BASE" "$LOCAL" "$REMOTE" "$MERGED"]
+		} else {
+			set cmdline [list "$merge_tool_path" -wait -2 \
+				 -title1:"'$MERGED (Local)'" -title2:"'$MERGED (Remote)'" \
+				 "$LOCAL" "$REMOTE" "$MERGED"]
+		}
+	}
+	p4merge {
+		set cmdline [list "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"]
+	}
 	vimdiff {
 		error_popup [mc "Not a GUI merge tool: '%s'" $tool]
 		return
@@ -236,6 +262,7 @@ proc merge_tool_get_stages {target stages} {
 	foreach fname $stages {
 		if {$merge_stages($i) eq {}} {
 			file delete $fname
+			catch { close [open $fname w] }
 		} else {
 			# A hack to support autocrlf properly
 			git checkout-index -f --stage=$i -- $target
-- 
1.6.0.20.g6148bc
Previous: Alexander GavrilovNext: Alexander Gavrilov
Message 5 of 21 in “Add mergetool functionality to git-gui.”
  1. 0/8 Add mergetool functionality to git-gui.Alexander Gavrilov, Aug 30, 2008
  2. 1/8 git-gui: Don't allow staging files with conflicts.Alexander Gavrilov, Aug 30, 2008
  3. 2/8 git-gui: Support resolving conflicts via the diff context menu.Alexander Gavrilov, Aug 30, 2008
  4. 3/8 git-gui: Support calling merge tools.Alexander Gavrilov, Aug 30, 2008
  5. 4/8 git-gui: Support more merge tools.Alexander Gavrilov, Aug 30, 2008
  6. 5/8 git-gui: Support conflict states _U & UT.Alexander Gavrilov, Aug 30, 2008
  7. 6/8 git-gui: Reimplement and enhance auto-selection of diffs.Alexander Gavrilov, Aug 30, 2008
  8. 7/8 git-gui: Make F5 reselect a diff, if an untracked file is selected.Alexander Gavrilov, Aug 30, 2008
  9. 8/8 git-gui: Show special diffs for complex conflict cases.Alexander Gavrilov, Aug 30, 2008
  10. Johannes SixtSep 8, 2008
  11. Alexander GavrilovSep 8, 2008
  12. 0/2 git-gui: issues with merge tool seriesJohannes Sixt, Sep 17, 2008
  13. 1/2 Revert "git-gui: Don't allow staging files with conflicts."Johannes Sixt, Sep 17, 2008
  14. 2/2 git-gui: Do not automatically stage file after merge tool finishesJohannes Sixt, Sep 17, 2008
  15. Alexander GavrilovSep 17, 2008
  16. Shawn O. PearceSep 24, 2008
  17. 2/2 git-gui: Do not automatically stage file after merge tool finishesJohannes Sixt, Sep 24, 2008
  18. Alexander GavrilovSep 17, 2008
  19. Johannes SixtSep 17, 2008
  20. Alexander GavrilovSep 17, 2008
  21. Shawn O. PearceSep 24, 2008

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.