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

[PATCH] Open external merge tool with original file extensions in all three files

From
PRPini Reznik <pinir@expand.com>
Date
Dec 3, 2007, 15:31 UTC
Message-ID
<1196695874-22567-1-git-send-email-pinir@expand.com>

This required to be able to use syntax highlighting in meld during conflicts resolution. Before this change, two merged versions of file with a conflict were open with temporal extensions .LOCAL.$$ and REMOTE.$$ This way they were not recognized as a code files.

Signed-off-by: Pini Reznik <pinir@expand.com>
---
 git-mergetool.sh |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 5587c5e..4c15d22 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -152,10 +152,11 @@ merge_file () {
 	exit 1
     fi
 
-    BACKUP="$path.BACKUP.$$"
-    LOCAL="$path.LOCAL.$$"
-    REMOTE="$path.REMOTE.$$"
-    BASE="$path.BASE.$$"
+    extension=`echo $path | awk -F \. '{print $NF}'`
+    BACKUP="$path.BACKUP.$$.${extension}"
+    LOCAL="$path.LOCAL.$$.${extension}"
+    REMOTE="$path.REMOTE.$$.${extension}"
+    BASE="$path.BASE.$$.${extension}"
 
     mv -- "$path" "$BACKUP"
     cp -- "$BACKUP" "$path"
-- 
1.5.3.5
Next: Junio C Hamano
Message 1 of 3 in “Open external merge tool with original file extensions in all three files”
  1. Open external merge tool with original file extensions in all three filesPini Reznik, Dec 3, 2007
  2. Junio C HamanoDec 3, 2007
  3. Junio C HamanoDec 3, 2007

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.