{"thread":{"id":"11138","subject":"[PATCH] Open external merge tool with original file extensions for all three files","startedAt":"2007-12-05T07:19:13Z","lastAt":"2007-12-05T07:24:27Z","messageCount":2,"participants":["Pini Reznik","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"61977","messageId":"1196839153-31084-1-git-send-email-pinir@expand.com","threadId":"11138","inReplyTo":null,"subject":"[PATCH] Open external merge tool with original file extensions for all three files","fromName":"Pini Reznik","fromEmail":"pinir@expand.com","sentAt":"2007-12-05T07:19:13Z","receivedAt":"2007-12-05T07:19:13Z","isPatch":true,"sender":{"key":"pinir@expand.com","avatar":null},"body":"Before this fix conflicted files were open in external merge tool with temporal extensions like REMOTE.$$ and LOCAL.$$.\nThis way meld was unable to recognize these files and syntax highlighting feature was unusable.\n\n\nSigned-off-by: Pini Reznik <pinir@expand.com>\n---\n git-mergetool.sh |    9 +++++----\n 1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 5587c5e..2f31fa2 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -152,10 +152,11 @@ merge_file () {\n \texit 1\n     fi\n \n-    BACKUP=\"$path.BACKUP.$$\"\n-    LOCAL=\"$path.LOCAL.$$\"\n-    REMOTE=\"$path.REMOTE.$$\"\n-    BASE=\"$path.BASE.$$\"\n+    ext=\"$$$(expr \"$path\" : '.*\\(\\.[^/]*\\)$')\"\n+    BACKUP=\"$path.BACKUP.$ext\"\n+    LOCAL=\"$path.LOCAL.$ext\"\n+    REMOTE=\"$path.REMOTE.$ext\"\n+    BASE=\"$path.BASE.$ext\"\n \n     mv -- \"$path\" \"$BACKUP\"\n     cp -- \"$BACKUP\" \"$path\"\n-- \n1.5.3.5\n"},{"id":"61978","messageId":"7vve7dzjro.fsf@gitster.siamese.dyndns.org","threadId":"11138","inReplyTo":"1196839153-31084-1-git-send-email-pinir@expand.com","subject":"Re: [PATCH] Open external merge tool with original file extensions for all three files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-05T07:24:27Z","receivedAt":"2007-12-05T07:24:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pini Reznik <pinir@expand.com> writes:\n\n> Before this fix conflicted files were open in external merge tool with temporal extensions like REMOTE.$$ and LOCAL.$$.\n> This way meld was unable to recognize these files and syntax highlighting feature was unusable.\n>\n>\n> Signed-off-by: Pini Reznik <pinir@expand.com>\n\nI have to wonder if it is fashionable to use overlooooong lines on this\nlist today...  Please linewrap commit log message.\n\nTed, you added meld from the beginning to git-mergetool.  Does the patch\nlook good?\n\n> ---\n>  git-mergetool.sh |    9 +++++----\n>  1 files changed, 5 insertions(+), 4 deletions(-)\n>\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index 5587c5e..2f31fa2 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -152,10 +152,11 @@ merge_file () {\n>  \texit 1\n>      fi\n>  \n> -    BACKUP=\"$path.BACKUP.$$\"\n> -    LOCAL=\"$path.LOCAL.$$\"\n> -    REMOTE=\"$path.REMOTE.$$\"\n> -    BASE=\"$path.BASE.$$\"\n> +    ext=\"$$$(expr \"$path\" : '.*\\(\\.[^/]*\\)$')\"\n> +    BACKUP=\"$path.BACKUP.$ext\"\n> +    LOCAL=\"$path.LOCAL.$ext\"\n> +    REMOTE=\"$path.REMOTE.$ext\"\n> +    BASE=\"$path.BASE.$ext\"\n\nI realize '.*\\(\\.[^./]*\\)$' might have been better, as the above\nexpression as written will slurp \".b.c\" as ext from \"foo.b.c\", but\nprobably for \"merger knows the file type with file extension\" purpose,\nit does not make a difference.\n"}]}