git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] Allow the user to change the temporary file name for mergetool

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 19, 2014, 18:01 UTC
Message-ID
<xmqqwqa4uzmw.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1408468545-6879-1-git-send-email-robin.rosenberg@dewire.com>
Robin Rosenberg <robin.rosenberg@dewire.com> writes:
Show 12 quoted lines
> Using the original filename suffix for the temporary input files to
> the merge tool confuses IDEs like Eclipse. This patch introduces
> a configurtion option, mergetool.tmpsuffix, which get appended to
> the temporary file name. That way the user can choose to use a
> suffix like ".tmp", which does not cause confusion.
>
> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
> ---
>  Documentation/config.txt        |  5 +++++
>  Documentation/git-mergetool.txt |  7 +++++++
>  git-mergetool.sh                | 10 ++++++----
>  3 files changed, 18 insertions(+), 4 deletions(-)
Thanks for a quick turn-around.
Show 17 quoted lines
>
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index c55c22a..0e15800 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1778,6 +1778,11 @@ notes.displayRef::
>  	several times.  A warning will be issued for refs that do not
>  	exist, but a glob that does not match any refs is silently
>  	ignored.
> +
> +mergetool.tmpsuffix::
> +	A string to append the names of the temporary files mergetool
> +	creates in the worktree as input to a custom merge tool. The
> +	primary use is to avoid confusion in IDEs during merge.
>  +
>  This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`
>  environment variable, which must be a colon separated list of refs or

I smell that the new paragraph is inserted at a wrong place. What does notes-display-ref environment have anything to do with this variable?

Also, could you phrase this in a way to hint that the users are likely to want to begin the value for this variable with a dot (or some other special character)? Your 'suffix like ".tmp"' in the proposed log message does it very nicely [*1*], and I'd like to see the same done for the end users who do not have access to our log message but do have access to our documentation pages.

Same comment applies to the new paragraph in the documentation of git-mergetool itself.

Show 15 quoted lines
> diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
> index e846c2e..80a0526 100644
> --- a/Documentation/git-mergetool.txt
> +++ b/Documentation/git-mergetool.txt
> @@ -89,6 +89,13 @@ Setting the `mergetool.keepBackup` configuration variable to `false`
>  causes `git mergetool` to automatically remove the backup as files
>  are successfully merged.
>  
> +`git mergetool` may also create other temporary files for the
> +different versions involved in the merge. By default these files have
> +the same filename suffix as the file being merged. This may confuse
> +other tools in use during a long merge operation. The user can set
> +`mergetool.tmpsuffix` to be used as an extra suffix, which will be
> +appened to the temporary filename to lessen that problem.
> +
[Footnote]

*1* To anybody remotely intelligent (like me), it hints that a temporary file would have a name like "hello.rbtmp" if it is set to "tmp", to let them make a natural inference that they are better off using something like ".tmp", "~tmp", "+tmp", etc.

Previous: Robin RosenbergNext: Johannes Sixt
Message 6 of 12 in “Allow the user to change the temporary file name for mergetool”
  1. Allow the user to change the temporary file name for mergetoolRobin Rosenberg, Aug 19, 2014
  2. Stefan NäweAug 19, 2014
  3. Allow the user to change the temporary file name for mergetoolRobin Rosenberg, Aug 19, 2014
  4. Junio C HamanoAug 19, 2014
  5. Allow the user to change the temporary file name for mergetoolRobin Rosenberg, Aug 19, 2014
  6. Junio C HamanoAug 19, 2014
  7. Johannes SixtAug 19, 2014
  8. Junio C HamanoAug 19, 2014
  9. Robin RosenbergAug 20, 2014
  10. Allow the user to change the temporary file name for mergetoolRobin Rosenberg, Aug 21, 2014
  11. Junio C HamanoAug 21, 2014
  12. Stefan NäweAug 20, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.