{"thread":{"id":"37376","subject":"[PATCH] Allow the user to change the temporary file name for mergetool","startedAt":"2014-08-19T12:22:48Z","lastAt":"2014-08-21T20:04:24Z","messageCount":12,"participants":["Robin Rosenberg","Stefan Näwe","Junio C Hamano","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"247906","messageId":"1408450968-3465-1-git-send-email-robin.rosenberg@dewire.com","threadId":"37376","inReplyTo":null,"subject":"[PATCH] Allow the user to change the temporary file name for mergetool","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2014-08-19T12:22:48Z","receivedAt":"2014-08-19T12:22:48Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Using the original filename suffix for the temporary input files to\nthe merge tool confuses IDEs like Eclipse. This patch introduces\na configurtion option, mergetool.tmpsuffix, which get appended to\nthe temporary file name. That way the user can choose to use a\nsuffix like \".tmp\", which does not cause confusion.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n Documentation/git-mergetool.txt |  7 +++++++\n git-mergetool.sh                | 10 ++++++----\n 2 files changed, 13 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e846c2e..a586766 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`\n causes `git mergetool` to automatically remove the backup as files\n are successfully merged.\n \n+`git mergetool` may also create other temporary files for the\n+different versions involved in the merge. By default these files have\n+the same filename suffix as the file being merged. This may confuse\n+other tools in use during a long merge operation. The user can set\n+`mergtool.tmpsuffix` to be used as an extra suffix, which will be\n+appened to the temporary filenamame to lessen that problem.\n+\n GIT\n ---\n Part of the linkgit:git[1] suite\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 9a046b7..d7cc76c 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -214,6 +214,8 @@ checkout_staged_file () {\n }\n \n merge_file () {\n+\ttmpsuffix=$(git config mergetool.tmpsuffix || true)\n+\n \tMERGED=\"$1\"\n \n \tf=$(git ls-files -u -- \"$MERGED\")\n@@ -229,10 +231,10 @@ merge_file () {\n \tfi\n \n \text=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n-\tBACKUP=\"./$MERGED.BACKUP.$ext\"\n-\tLOCAL=\"./$MERGED.LOCAL.$ext\"\n-\tREMOTE=\"./$MERGED.REMOTE.$ext\"\n-\tBASE=\"./$MERGED.BASE.$ext\"\n+\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n+\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n+\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n+\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n \n \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n-- \n2.1.0.rc2.6.g39c33ff.dirty\n"},{"id":"247907","messageId":"53F3489E.9050302@atlas-elektronik.com","threadId":"37376","inReplyTo":"1408450968-3465-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [PATCH] Allow the user to change the temporary file name for mergetool","fromName":"Stefan Näwe","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2014-08-19T12:52:46Z","receivedAt":"2014-08-19T12:52:46Z","isPatch":true,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"Am 19.08.2014 um 14:22 schrieb Robin Rosenberg:\n> Using the original filename suffix for the temporary input files to\n> the merge tool confuses IDEs like Eclipse. This patch introduces\n> a configurtion option, mergetool.tmpsuffix, which get appended to\n> the temporary file name. That way the user can choose to use a\n> suffix like \".tmp\", which does not cause confusion.\n> \n> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n> ---\n>  Documentation/git-mergetool.txt |  7 +++++++\n>  git-mergetool.sh                | 10 ++++++----\n>  2 files changed, 13 insertions(+), 4 deletions(-)\n> \n> diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\n> index e846c2e..a586766 100644\n> --- a/Documentation/git-mergetool.txt\n> +++ b/Documentation/git-mergetool.txt\n> @@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`\n>  causes `git mergetool` to automatically remove the backup as files\n>  are successfully merged.\n>  \n> +`git mergetool` may also create other temporary files for the\n> +different versions involved in the merge. By default these files have\n> +the same filename suffix as the file being merged. This may confuse\n> +other tools in use during a long merge operation. The user can set\n> +`mergtool.tmpsuffix` to be used as an extra suffix, which will be\n\ns/mergtool/mergetool/\n\n> +appened to the temporary filenamame to lessen that problem.\n\ns/appened/appended/\ns/filenamame/filename/\n\n> +\n>  GIT\n>  ---\n>  Part of the linkgit:git[1] suite\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index 9a046b7..d7cc76c 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -214,6 +214,8 @@ checkout_staged_file () {\n>  }\n>  \n>  merge_file () {\n> +\ttmpsuffix=$(git config mergetool.tmpsuffix || true)\n> +\n>  \tMERGED=\"$1\"\n>  \n>  \tf=$(git ls-files -u -- \"$MERGED\")\n> @@ -229,10 +231,10 @@ merge_file () {\n>  \tfi\n>  \n>  \text=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n> -\tBACKUP=\"./$MERGED.BACKUP.$ext\"\n> -\tLOCAL=\"./$MERGED.LOCAL.$ext\"\n> -\tREMOTE=\"./$MERGED.REMOTE.$ext\"\n> -\tBASE=\"./$MERGED.BASE.$ext\"\n> +\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n> +\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n> +\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n> +\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n>  \n>  \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n>  \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n> \n\nStefan\n-- \n----------------------------------------------------------------\n/dev/random says: Confusion not only reigns, it pours.\npython -c \"print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')\" \nGPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF\n"},{"id":"247909","messageId":"1408460112-6206-1-git-send-email-robin.rosenberg@dewire.com","threadId":"37376","inReplyTo":"53F3489E.9050302@atlas-elektronik.com","subject":"[PATCH v2] Allow the user to change the temporary file name for mergetool","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2014-08-19T14:55:12Z","receivedAt":"2014-08-19T14:55:12Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Using the original filename suffix for the temporary input files to\nthe merge tool confuses IDEs like Eclipse. This patch introduces\na configurtion option, mergetool.tmpsuffix, which get appended to\nthe temporary file name. That way the user can choose to use a\nsuffix like \".tmp\", which does not cause confusion.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n Documentation/git-mergetool.txt |  7 +++++++\n git-mergetool.sh                | 10 ++++++----\n 2 files changed, 13 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e846c2e..80a0526 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`\n causes `git mergetool` to automatically remove the backup as files\n are successfully merged.\n \n+`git mergetool` may also create other temporary files for the\n+different versions involved in the merge. By default these files have\n+the same filename suffix as the file being merged. This may confuse\n+other tools in use during a long merge operation. The user can set\n+`mergetool.tmpsuffix` to be used as an extra suffix, which will be\n+appened to the temporary filename to lessen that problem.\n+\n GIT\n ---\n Part of the linkgit:git[1] suite\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 9a046b7..d7cc76c 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -214,6 +214,8 @@ checkout_staged_file () {\n }\n \n merge_file () {\n+\ttmpsuffix=$(git config mergetool.tmpsuffix || true)\n+\n \tMERGED=\"$1\"\n \n \tf=$(git ls-files -u -- \"$MERGED\")\n@@ -229,10 +231,10 @@ merge_file () {\n \tfi\n \n \text=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n-\tBACKUP=\"./$MERGED.BACKUP.$ext\"\n-\tLOCAL=\"./$MERGED.LOCAL.$ext\"\n-\tREMOTE=\"./$MERGED.REMOTE.$ext\"\n-\tBASE=\"./$MERGED.BASE.$ext\"\n+\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n+\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n+\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n+\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n \n \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n-- \n2.1.0.rc2.6.g39c33ff.dirty\n"},{"id":"247951","messageId":"xmqqa970wgy0.fsf@gitster.dls.corp.google.com","threadId":"37376","inReplyTo":"1408460112-6206-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [PATCH v2] Allow the user to change the temporary file name for mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-08-19T17:02:47Z","receivedAt":"2014-08-19T17:02:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg@dewire.com> writes:\n\n> Using the original filename suffix for the temporary input files to\n> the merge tool confuses IDEs like Eclipse. This patch introduces\n> a configurtion option, mergetool.tmpsuffix, which get appended to\n> the temporary file name. That way the user can choose to use a\n> suffix like \".tmp\", which does not cause confusion.\n>\n> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n> ---\n>  Documentation/git-mergetool.txt |  7 +++++++\n>  git-mergetool.sh                | 10 ++++++----\n>  2 files changed, 13 insertions(+), 4 deletions(-)\n\nNo updates to Documentation/config.txt to describe the new variable?\n\n>\n> diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\n> index e846c2e..80a0526 100644\n> --- a/Documentation/git-mergetool.txt\n> +++ b/Documentation/git-mergetool.txt\n> @@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`\n>  causes `git mergetool` to automatically remove the backup as files\n>  are successfully merged.\n>  \n> +`git mergetool` may also create other temporary files for the\n> +different versions involved in the merge. By default these files have\n> +the same filename suffix as the file being merged. This may confuse\n> +other tools in use during a long merge operation. The user can set\n> +`mergetool.tmpsuffix` to be used as an extra suffix, which will be\n> +appened to the temporary filename to lessen that problem.\n> +\n>  GIT\n>  ---\n>  Part of the linkgit:git[1] suite\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index 9a046b7..d7cc76c 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -214,6 +214,8 @@ checkout_staged_file () {\n>  }\n>  \n>  merge_file () {\n> +\ttmpsuffix=$(git config mergetool.tmpsuffix || true)\n> +\n>  \tMERGED=\"$1\"\n>  \n>  \tf=$(git ls-files -u -- \"$MERGED\")\n> @@ -229,10 +231,10 @@ merge_file () {\n>  \tfi\n>  \n>  \text=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n> -\tBACKUP=\"./$MERGED.BACKUP.$ext\"\n> -\tLOCAL=\"./$MERGED.LOCAL.$ext\"\n> -\tREMOTE=\"./$MERGED.REMOTE.$ext\"\n> -\tBASE=\"./$MERGED.BASE.$ext\"\n> +\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n> +\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n> +\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n> +\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n>  \n>  \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n>  \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n"},{"id":"247953","messageId":"1408468545-6879-1-git-send-email-robin.rosenberg@dewire.com","threadId":"37376","inReplyTo":"xmqqa970wgy0.fsf@gitster.dls.corp.google.com","subject":"[PATCH v3] Allow the user to change the temporary file name for mergetool","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2014-08-19T17:15:45Z","receivedAt":"2014-08-19T17:15:45Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Using the original filename suffix for the temporary input files to\nthe merge tool confuses IDEs like Eclipse. This patch introduces\na configurtion option, mergetool.tmpsuffix, which get appended to\nthe temporary file name. That way the user can choose to use a\nsuffix like \".tmp\", which does not cause confusion.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n Documentation/config.txt        |  5 +++++\n Documentation/git-mergetool.txt |  7 +++++++\n git-mergetool.sh                | 10 ++++++----\n 3 files changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex c55c22a..0e15800 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1778,6 +1778,11 @@ notes.displayRef::\n \tseveral times.  A warning will be issued for refs that do not\n \texist, but a glob that does not match any refs is silently\n \tignored.\n+\n+mergetool.tmpsuffix::\n+\tA string to append the names of the temporary files mergetool\n+\tcreates in the worktree as input to a custom merge tool. The\n+\tprimary use is to avoid confusion in IDEs during merge.\n +\n This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`\n environment variable, which must be a colon separated list of refs or\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e846c2e..80a0526 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`\n causes `git mergetool` to automatically remove the backup as files\n are successfully merged.\n \n+`git mergetool` may also create other temporary files for the\n+different versions involved in the merge. By default these files have\n+the same filename suffix as the file being merged. This may confuse\n+other tools in use during a long merge operation. The user can set\n+`mergetool.tmpsuffix` to be used as an extra suffix, which will be\n+appened to the temporary filename to lessen that problem.\n+\n GIT\n ---\n Part of the linkgit:git[1] suite\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 9a046b7..d7cc76c 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -214,6 +214,8 @@ checkout_staged_file () {\n }\n \n merge_file () {\n+\ttmpsuffix=$(git config mergetool.tmpsuffix || true)\n+\n \tMERGED=\"$1\"\n \n \tf=$(git ls-files -u -- \"$MERGED\")\n@@ -229,10 +231,10 @@ merge_file () {\n \tfi\n \n \text=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n-\tBACKUP=\"./$MERGED.BACKUP.$ext\"\n-\tLOCAL=\"./$MERGED.LOCAL.$ext\"\n-\tREMOTE=\"./$MERGED.REMOTE.$ext\"\n-\tBASE=\"./$MERGED.BASE.$ext\"\n+\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n+\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n+\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n+\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n \n \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n-- \n2.1.0.rc2.6.g39c33ff.dirty\n"},{"id":"247955","messageId":"xmqqwqa4uzmw.fsf@gitster.dls.corp.google.com","threadId":"37376","inReplyTo":"1408468545-6879-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [PATCH v3] Allow the user to change the temporary file name for mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-08-19T18:01:59Z","receivedAt":"2014-08-19T18:01:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg@dewire.com> writes:\n\n> Using the original filename suffix for the temporary input files to\n> the merge tool confuses IDEs like Eclipse. This patch introduces\n> a configurtion option, mergetool.tmpsuffix, which get appended to\n> the temporary file name. That way the user can choose to use a\n> suffix like \".tmp\", which does not cause confusion.\n>\n> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n> ---\n>  Documentation/config.txt        |  5 +++++\n>  Documentation/git-mergetool.txt |  7 +++++++\n>  git-mergetool.sh                | 10 ++++++----\n>  3 files changed, 18 insertions(+), 4 deletions(-)\n\nThanks for a quick turn-around.\n\n>\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index c55c22a..0e15800 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1778,6 +1778,11 @@ notes.displayRef::\n>  \tseveral times.  A warning will be issued for refs that do not\n>  \texist, but a glob that does not match any refs is silently\n>  \tignored.\n> +\n> +mergetool.tmpsuffix::\n> +\tA string to append the names of the temporary files mergetool\n> +\tcreates in the worktree as input to a custom merge tool. The\n> +\tprimary use is to avoid confusion in IDEs during merge.\n>  +\n>  This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`\n>  environment variable, which must be a colon separated list of refs or\n\nI smell that the new paragraph is inserted at a wrong place.  What\ndoes notes-display-ref environment have anything to do with this\nvariable?\n\nAlso, could you phrase this in a way to hint that the users are\nlikely to want to begin the value for this variable with a dot (or\nsome other special character)?  Your 'suffix like \".tmp\"' in the\nproposed log message does it very nicely [*1*], and I'd like to see the\nsame done for the end users who do not have access to our log\nmessage but do have access to our documentation pages.\n\nSame comment applies to the new paragraph in the documentation of\ngit-mergetool itself.\n\n> diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\n> index e846c2e..80a0526 100644\n> --- a/Documentation/git-mergetool.txt\n> +++ b/Documentation/git-mergetool.txt\n> @@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`\n>  causes `git mergetool` to automatically remove the backup as files\n>  are successfully merged.\n>  \n> +`git mergetool` may also create other temporary files for the\n> +different versions involved in the merge. By default these files have\n> +the same filename suffix as the file being merged. This may confuse\n> +other tools in use during a long merge operation. The user can set\n> +`mergetool.tmpsuffix` to be used as an extra suffix, which will be\n> +appened to the temporary filename to lessen that problem.\n> +\n\n[Footnote]\n\n*1* To anybody remotely intelligent (like me), it hints that a\ntemporary file would have a name like \"hello.rbtmp\" if it is set to\n\"tmp\", to let them make a natural inference that they are better off\nusing something like \".tmp\", \"~tmp\", \"+tmp\", etc.\n"},{"id":"247966","messageId":"53F3B565.5080309@kdbg.org","threadId":"37376","inReplyTo":"1408468545-6879-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [PATCH v3] Allow the user to change the temporary file name for mergetool","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2014-08-19T20:36:53Z","receivedAt":"2014-08-19T20:36:53Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 19.08.2014 19:15, schrieb Robin Rosenberg:\n> Using the original filename suffix for the temporary input files to\n> the merge tool confuses IDEs like Eclipse. This patch introduces\n> a configurtion option, mergetool.tmpsuffix, which get appended to\n> the temporary file name. That way the user can choose to use a\n> suffix like \".tmp\", which does not cause confusion.\n\nI have a merge tool that does syntax highlighting based on the file\nextension. Given this:\n\n> +\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n> +\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n> +\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n> +\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n\nI guess I lose syntax highlighting if I were to use mergetool.tmpsuffix;\nbut then I don't use Eclipse. Could it be that this is really just a\nband-aid for Eclipse users, not IDEs in general as you are hinting in\nthe Documentation of the new variable?\n\n-- Hannes\n"},{"id":"247988","messageId":"xmqqk364unya.fsf@gitster.dls.corp.google.com","threadId":"37376","inReplyTo":"53F3B565.5080309@kdbg.org","subject":"Re: [PATCH v3] Allow the user to change the temporary file name for mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-08-19T22:14:21Z","receivedAt":"2014-08-19T22:14:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Am 19.08.2014 19:15, schrieb Robin Rosenberg:\n>> Using the original filename suffix for the temporary input files to\n>> the merge tool confuses IDEs like Eclipse. This patch introduces\n>> a configurtion option, mergetool.tmpsuffix, which get appended to\n>> the temporary file name. That way the user can choose to use a\n>> suffix like \".tmp\", which does not cause confusion.\n>\n> I have a merge tool that does syntax highlighting based on the file\n> extension. Given this:\n>\n>> +\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n>> +\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n>> +\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n>> +\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n>\n> I guess I lose syntax highlighting if I were to use mergetool.tmpsuffix;\n> but then I don't use Eclipse. Could it be that this is really just a\n> band-aid for Eclipse users, not IDEs in general as you are hinting in\n> the Documentation of the new variable?\n\nThe phrase \"IDEs like Eclipse\" in the proposed log message did not\ntell me (which I think is a good thing) if IDEs that need \"band-aid\"\nare majority or minority, but I agree that we should not hint that\nIDEs in general would benefit by setting this variable.  A warning\non the syntax-aware editors may be necessary.\n\nThanks for a careful reading.\n"},{"id":"248003","messageId":"53F44CC7.4040809@atlas-elektronik.com","threadId":"37376","inReplyTo":"1408468545-6879-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [PATCH v3] Allow the user to change the temporary file name for mergetool","fromName":"Stefan Näwe","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2014-08-20T07:22:47Z","receivedAt":"2014-08-20T07:22:47Z","isPatch":true,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"Am 19.08.2014 um 19:15 schrieb Robin Rosenberg:\n> Using the original filename suffix for the temporary input files to\n> the merge tool confuses IDEs like Eclipse. This patch introduces\n> a configurtion option, mergetool.tmpsuffix, which get appended to\n> the temporary file name. That way the user can choose to use a\n> suffix like \".tmp\", which does not cause confusion.\n> \n> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n> ---\n>  Documentation/config.txt        |  5 +++++\n>  Documentation/git-mergetool.txt |  7 +++++++\n>  git-mergetool.sh                | 10 ++++++----\n>  3 files changed, 18 insertions(+), 4 deletions(-)\n> \n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index c55c22a..0e15800 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1778,6 +1778,11 @@ notes.displayRef::\n>  \tseveral times.  A warning will be issued for refs that do not\n>  \texist, but a glob that does not match any refs is silently\n>  \tignored.\n> +\n> +mergetool.tmpsuffix::\n> +\tA string to append the names of the temporary files mergetool\n> +\tcreates in the worktree as input to a custom merge tool. The\n> +\tprimary use is to avoid confusion in IDEs during merge.\n>  +\n>  This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`\n>  environment variable, which must be a colon separated list of refs or\n> diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\n> index e846c2e..80a0526 100644\n> --- a/Documentation/git-mergetool.txt\n> +++ b/Documentation/git-mergetool.txt\n> @@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`\n>  causes `git mergetool` to automatically remove the backup as files\n>  are successfully merged.\n>  \n> +`git mergetool` may also create other temporary files for the\n> +different versions involved in the merge. By default these files have\n> +the same filename suffix as the file being merged. This may confuse\n> +other tools in use during a long merge operation. The user can set\n> +`mergetool.tmpsuffix` to be used as an extra suffix, which will be\n> +appened to the temporary filename to lessen that problem.\n\nStill:\n\ns/appened/appended/\n\n> +\n>  GIT\n>  ---\n>  Part of the linkgit:git[1] suite\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index 9a046b7..d7cc76c 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -214,6 +214,8 @@ checkout_staged_file () {\n>  }\n>  \n>  merge_file () {\n> +\ttmpsuffix=$(git config mergetool.tmpsuffix || true)\n> +\n>  \tMERGED=\"$1\"\n>  \n>  \tf=$(git ls-files -u -- \"$MERGED\")\n> @@ -229,10 +231,10 @@ merge_file () {\n>  \tfi\n>  \n>  \text=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n> -\tBACKUP=\"./$MERGED.BACKUP.$ext\"\n> -\tLOCAL=\"./$MERGED.LOCAL.$ext\"\n> -\tREMOTE=\"./$MERGED.REMOTE.$ext\"\n> -\tBASE=\"./$MERGED.BASE.$ext\"\n> +\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n> +\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n> +\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n> +\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n>  \n>  \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n>  \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n> \n\nStefan\n-- \n----------------------------------------------------------------\n/dev/random says: It's Ensign Flintstone, Jim... He's Fred!\npython -c \"print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')\" \nGPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF\n"},{"id":"248004","messageId":"1933929003.2352.1408519467593.JavaMail.zimbra@dewire.com","threadId":"37376","inReplyTo":"xmqqk364unya.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v3] Allow the user to change the temporary file name for mergetool","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2014-08-20T07:24:27Z","receivedAt":"2014-08-20T07:24:27Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"\n\n----- Ursprungligt meddelande -----\n> Från: \"Junio C Hamano\" <gitster@pobox.com>\n> Till: \"Johannes Sixt\" <j6t@kdbg.org>\n> Kopia: \"Robin Rosenberg\" <robin.rosenberg@dewire.com>, git@vger.kernel.org\n> Skickat: onsdag, 20 aug 2014 0:14:21\n> Ämne: Re: [PATCH v3] Allow the user to change the temporary file name for mergetool\n> \n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n> > Am 19.08.2014 19:15, schrieb Robin Rosenberg:\n> >> Using the original filename suffix for the temporary input files to\n> >> the merge tool confuses IDEs like Eclipse. This patch introduces\n> >> a configurtion option, mergetool.tmpsuffix, which get appended to\n> >> the temporary file name. That way the user can choose to use a\n> >> suffix like \".tmp\", which does not cause confusion.\n> >\n> > I have a merge tool that does syntax highlighting based on the file\n> > extension. Given this:\n> >\n> >> +\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n> >> +\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n> >> +\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n> >> +\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n> >\n> > I guess I lose syntax highlighting if I were to use mergetool.tmpsuffix;\n> > but then I don't use Eclipse. Could it be that this is really just a\n> > band-aid for Eclipse users, not IDEs in general as you are hinting in\n> > the Documentation of the new variable?\n> \n> The phrase \"IDEs like Eclipse\" in the proposed log message did not\n> tell me (which I think is a good thing) if IDEs that need \"band-aid\"\n> are majority or minority, but I agree that we should not hint that\n> IDEs in general would benefit by setting this variable.  A warning\n> on the syntax-aware editors may be necessary.\n\nI'm not sure it's necessary since it is not a default. If you use the\nsetting you are probably well aware of why you use it, and the \npossible implications.\n\nI have only had the problem with Eclipse, but I imagine any tool that\n\"owns\" a directory and scans it for changes will find these temporary\nfiles and do something unexpected based on the suffix. By setting the\nsuffix to something insert, like txt, tmp, dat or whatever you prevent\nthat tool from thinking too much.\n\nIn concrete terms, what happens is that Eclipse, in my case, find\ntemporary filenames with the suffix Foo.REMOTE.java and thinks that\nis the one source file for Foo since it contains the source for Foo.\n\nSure you lose syntax highlighting, that's a trade-off. An alternative\nsolution would be to put these files somewhere else.\n\n-- robin\n"},{"id":"248043","messageId":"1408607240-11369-1-git-send-email-robin.rosenberg@dewire.com","threadId":"37376","inReplyTo":"1933929003.2352.1408519467593.JavaMail.zimbra@dewire.com","subject":"[PATCH v4] Allow the user to change the temporary file name for mergetool","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2014-08-21T07:47:20Z","receivedAt":"2014-08-21T07:47:20Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Using the original filename suffix for the temporary input files to\nthe merge tool confuses IDEs like Eclipse. This patch introduces\na configurtion option, mergetool.tmpsuffix, which get appended to\nthe temporary file name. That way the user can choose to use a\nsuffix like \".tmp\", which does not cause confusion.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n Documentation/config.txt        |  5 +++++\n Documentation/git-mergetool.txt |  7 +++++++\n git-mergetool.sh                | 10 ++++++----\n 3 files changed, 18 insertions(+), 4 deletions(-)\n\nFixed a spelling error.\n\n-- robin\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex c55c22a..0e15800 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1778,6 +1778,11 @@ notes.displayRef::\n \tseveral times.  A warning will be issued for refs that do not\n \texist, but a glob that does not match any refs is silently\n \tignored.\n+\n+mergetool.tmpsuffix::\n+\tA string to append the names of the temporary files mergetool\n+\tcreates in the worktree as input to a custom merge tool. The\n+\tprimary use is to avoid confusion in IDEs during merge.\n +\n This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`\n environment variable, which must be a colon separated list of refs or\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e846c2e..80a0526 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`\n causes `git mergetool` to automatically remove the backup as files\n are successfully merged.\n \n+`git mergetool` may also create other temporary files for the\n+different versions involved in the merge. By default these files have\n+the same filename suffix as the file being merged. This may confuse\n+other tools in use during a long merge operation. The user can set\n+`mergetool.tmpsuffix` to be used as an extra suffix, which will be\n+appened to the temporary filename to lessen that problem.\n+\n GIT\n ---\n Part of the linkgit:git[1] suite\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 9a046b7..d7cc76c 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -214,6 +214,8 @@ checkout_staged_file () {\n }\n \n merge_file () {\n+\ttmpsuffix=$(git config mergetool.tmpsuffix || true)\n+\n \tMERGED=\"$1\"\n \n \tf=$(git ls-files -u -- \"$MERGED\")\n@@ -229,10 +231,10 @@ merge_file () {\n \tfi\n \n \text=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n-\tBACKUP=\"./$MERGED.BACKUP.$ext\"\n-\tLOCAL=\"./$MERGED.LOCAL.$ext\"\n-\tREMOTE=\"./$MERGED.REMOTE.$ext\"\n-\tBASE=\"./$MERGED.BASE.$ext\"\n+\tBACKUP=\"./$MERGED.BACKUP.$ext$tmpsuffix\"\n+\tLOCAL=\"./$MERGED.LOCAL.$ext$tmpsuffix\"\n+\tREMOTE=\"./$MERGED.REMOTE.$ext$tmpsuffix\"\n+\tBASE=\"./$MERGED.BASE.$ext$tmpsuffix\"\n \n \tbase_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==1) print $1;}')\n \tlocal_mode=$(git ls-files -u -- \"$MERGED\" | awk '{if ($3==2) print $1;}')\n-- \n2.1.0.rc2.6.g39c33ff.dirty\n"},{"id":"248080","messageId":"xmqqvbplr4mv.fsf@gitster.dls.corp.google.com","threadId":"37376","inReplyTo":"1408607240-11369-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [PATCH v4] Allow the user to change the temporary file name for mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-08-21T20:04:24Z","receivedAt":"2014-08-21T20:04:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg@dewire.com> writes:\n\n> Using the original filename suffix for the temporary input files to\n> the merge tool confuses IDEs like Eclipse. This patch introduces\n> a configurtion option, mergetool.tmpsuffix, which get appended to\n> the temporary file name. That way the user can choose to use a\n> suffix like \".tmp\", which does not cause confusion.\n>\n> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n> ---\n>  Documentation/config.txt        |  5 +++++\n>  Documentation/git-mergetool.txt |  7 +++++++\n>  git-mergetool.sh                | 10 ++++++----\n>  3 files changed, 18 insertions(+), 4 deletions(-)\n>\n> Fixed a spelling error.\n\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index c55c22a..0e15800 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1778,6 +1778,11 @@ notes.displayRef::\n>  \tseveral times.  A warning will be issued for refs that do not\n>  \texist, but a glob that does not match any refs is silently\n>  \tignored.\n> +\n> +mergetool.tmpsuffix::\n> +\tA string to append the names of the temporary files mergetool\n> +\tcreates in the worktree as input to a custom merge tool. The\n> +\tprimary use is to avoid confusion in IDEs during merge.\n>  +\n>  This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`\n>  environment variable, which must be a colon separated list of refs or\n\nPlease read the surrounding text again and answer this question:\n\n    What is \"This setting\" the continued paragraph of your paragraph\n    that describes mergetool.tmpsuffix variable talks about?\n\nStated in another way, \"match any refs is silently ignored.\" is the\nend of the first paragraph for notes.displayRef.  \"This setting can\nbe overridden\" is the beginning of the second paragraph for the same\nvariable.\n\n> +`git mergetool` may also create other temporary files for the\n> +different versions involved in the merge. By default these files have\n> +the same filename suffix as the file being merged. This may confuse\n> +other tools in use during a long merge operation. The user can set\n\nI would suggest these changes:\n\n - replace \"being merged\" with \"being merged, so that editors and\n   IDEs can use the suffix for syntax highlighting\".\n\n - replace \"this may confuse other tools\" with \"this may confuse\n   some tools\".  The same tool that takes advantage of the suffix to\n   syntax-highlight may also be confused in a way that you deem\n   undesirable.\n\n - clarify what kind of confusion this warning is talking about, and\n   offer an example to avoid such confusion, and drop \"in use during\n   a long merge operation\", as that phrase alone, without knowing\n   in what way the tools are confused, is not useful to the readers.\n\nFor the last item, I unfortunately cannot offer a solid replacement\nphrasing, as it was not quite clear from your explanation during the\ndiscussion, at least to me.  Is it that Eclipse notices that a new\n\".java\" file in the working tree appeared and offers to add it or\nsomething?  If that is the case, then perhaps I would suggest\nsomething like this:\n\n    This reuse of the same file suffix may however confuse some\n    tools.  For example, Eclipse may notice, while resolving\n    conflicts on hello.java, that new files hello.LOCAL.java and\n    hello.REMOTE.java appear in your working tree and helpfully\n    offer to add it to your index and then upon conclusion of the\n    merge it would complain because these files are now gone.  To\n    avoid causing such confusion, you can use this variable to a\n    suffix that your IDE does not treat specially, e.g. \".tmp\" (this\n    may obviously lose syntax highlighting, though).\n\nBut I am not sure what confusion you are trying to work around, so\nthe single sentence that begins with \"For example,\" above would need\nto be completely rewritten, I guess.\n\nThanks.\n"}]}