Skip to content

Commit c3d51cd

Browse files
Pini Reznikgitster
authored andcommitted
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 <pinir@expand.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent cec99d8 commit c3d51cd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

git-mergetool.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@ merge_file () {
152152
exit 1
153153
fi
154154

155-
BACKUP="$path.BACKUP.$$"
156-
LOCAL="$path.LOCAL.$$"
157-
REMOTE="$path.REMOTE.$$"
158-
BASE="$path.BASE.$$"
155+
ext="$$$(expr "$path" : '.*\(\.[^/]*\)$')"
156+
BACKUP="$path.BACKUP.$ext"
157+
LOCAL="$path.LOCAL.$ext"
158+
REMOTE="$path.REMOTE.$ext"
159+
BASE="$path.BASE.$ext"
159160

160161
mv -- "$path" "$BACKUP"
161162
cp -- "$BACKUP" "$path"

0 commit comments

Comments
 (0)