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>
Pini Reznik committed
Dec 5, 2007 at 09:19 UTC
c3d51cd16a8db417b89608a37410cf3bf8a5b137
1 file changed
+5
-4
git-mergetool.sh
+5
-4
@@ -152,10 +152,11 @@ merge_file () {
152
exit 1
153
fi
154
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"
160
161
mv -- "$path" "$BACKUP"
162
cp -- "$BACKUP" "$path"