Skip to content

Commit

Permalink
Open external merge tool with original file extensions for all three …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Pini Reznik authored and Junio C Hamano committed Dec 6, 2007
1 parent cec99d8 commit c3d51cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions git-mergetool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c3d51cd

Please sign in to comment.