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

[PATCH] mergetool--lib: specialize diff options for emerge and ecmerge

From
David Aguilar <davvid@gmail.com>
Date
May 2, 2009, 08:57 UTC
Message-ID
<1241254641-54338-1-git-send-email-davvid@gmail.com>
The ecmerge documentation mentions the following form:
	ecmerge --mode=diff2 $1 $2

Since git-difftool is about diffing, we should use that instead of --mode=merge2. Likewise, this drops the $MERGED argument to emerge, as discussed on the git list ($gmane/117930).

Signed-off-by: David Aguilar <davvid@gmail.com>
---

I tested the emacs (emerge) bit, but I'm not an emacs user and I didn't really see any difference with or without the patch. Dropping $MERGED seems like the right thing to do nonetheless.

In emerge/emacs mode, we still end up seeing the merge pane. My emacs-fu is not sophisticated enough to know how to inhibit the merge pane (if that's even something we'd want to do).

Regarding ecmerge: I found the --mode=diff2 flag by reading their documenation:

http://www.elliecomputing.com/OnlineDoc/ecmerge_EN/52335623.asp

I don't have ecmerge installed at all, so I'm just going by the book on this one. It *looks* correct, and probably is, but let it be known that I haven't tested the ecmerge snippet myself.

 git-mergetool--lib.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index a16a279..8b5e6a8 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -228,8 +228,8 @@ run_merge_tool () {
 			fi
 			check_unchanged
 		else
-			"$merge_tool_path" "$LOCAL" "$REMOTE" \
-				--default --mode=merge2 --to="$MERGED"
+			"$merge_tool_path" --default --mode=diff2 \
+				"$LOCAL" "$REMOTE"
 		fi
 		;;
 	emerge)
@@ -248,7 +248,7 @@ run_merge_tool () {
 			status=$?
 		else
 			"$merge_tool_path" -f emerge-files-command \
-				"$LOCAL" "$REMOTE" "$(basename "$MERGED")"
+				"$LOCAL" "$REMOTE"
 		fi
 		;;
 	tortoisemerge)
-- 
1.6.3.rc3.40.g75b44
Next: David Aguilar
Message 1 of 7 in “mergetool--lib: specialize diff options for emerge and ecmerge”
  1. mergetool--lib: specialize diff options for emerge and ecmergeDavid Aguilar, May 2, 2009
  2. David AguilarMay 2, 2009
  3. Markus HeidelbergMay 3, 2009
  4. David AguilarMay 3, 2009
  5. Markus HeidelbergMay 3, 2009
  6. David AguilarMay 3, 2009
  7. Marcin ZalewskiMay 3, 2009

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.