From: Pini Reznik Date: Wed, 5 Dec 2007 07:19:13 +0000 (+0200) Subject: Open external merge tool with original file extensions for all three files X-Git-Tag: v1.5.4-rc0~36^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c3d51cd16a8db417b89608a37410cf3bf8a5b137;p=git.git Open external merge tool with original file extensions for all three files Before this change, conflicted files were open in external merge tool with temporary filenames like REMOTE.$$ and LOCAL.$$. This way meld was unable to recognize these files and syntax highlighting feature was unusable. Help such merge tools by giving temporar files the same extension as the original. Signed-off-by: Pini Reznik Signed-off-by: Junio C Hamano --- diff --git a/git-mergetool.sh b/git-mergetool.sh index 5587c5ece..2f31fa241 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.$$" + ext="$$$(expr "$path" : '.*\(\.[^/]*\)$')" + BACKUP="$path.BACKUP.$ext" + LOCAL="$path.LOCAL.$ext" + REMOTE="$path.REMOTE.$ext" + BASE="$path.BASE.$ext" mv -- "$path" "$BACKUP" cp -- "$BACKUP" "$path"