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
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Aug 20, 2014, 07:24 UTC
Message-ID
<1933929003.2352.1408519467593.JavaMail.zimbra@dewire.com>
In-Reply-To
<xmqqk364unya.fsf@gitster.dls.corp.google.com>
----- Ursprungligt meddelande -----
Show 33 quoted lines
> Från: "Junio C Hamano" <gitster@pobox.com>
> Till: "Johannes Sixt" <j6t@kdbg.org>
> Kopia: "Robin Rosenberg" <robin.rosenberg@dewire.com>, git@vger.kernel.org
> Skickat: onsdag, 20 aug 2014 0:14:21
> Ämne: Re: [PATCH v3] Allow the user to change the temporary file name for mergetool
> 
> Johannes Sixt <j6t@kdbg.org> writes:
> 
> > Am 19.08.2014 19:15, schrieb Robin Rosenberg:
> >> 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.
> >
> > I have a merge tool that does syntax highlighting based on the file
> > extension. Given this:
> >
> >> +	BACKUP="./$MERGED.BACKUP.$ext$tmpsuffix"
> >> +	LOCAL="./$MERGED.LOCAL.$ext$tmpsuffix"
> >> +	REMOTE="./$MERGED.REMOTE.$ext$tmpsuffix"
> >> +	BASE="./$MERGED.BASE.$ext$tmpsuffix"
> >
> > I guess I lose syntax highlighting if I were to use mergetool.tmpsuffix;
> > but then I don't use Eclipse. Could it be that this is really just a
> > band-aid for Eclipse users, not IDEs in general as you are hinting in
> > the Documentation of the new variable?
> 
> The phrase "IDEs like Eclipse" in the proposed log message did not
> tell me (which I think is a good thing) if IDEs that need "band-aid"
> are majority or minority, but I agree that we should not hint that
> IDEs in general would benefit by setting this variable.  A warning
> on the syntax-aware editors may be necessary.

I'm not sure it's necessary since it is not a default. If you use the setting you are probably well aware of why you use it, and the possible implications.

I have only had the problem with Eclipse, but I imagine any tool that "owns" a directory and scans it for changes will find these temporary files and do something unexpected based on the suffix. By setting the suffix to something insert, like txt, tmp, dat or whatever you prevent that tool from thinking too much.

In concrete terms, what happens is that Eclipse, in my case, find temporary filenames with the suffix Foo.REMOTE.java and thinks that is the one source file for Foo since it contains the source for Foo.

Sure you lose syntax highlighting, that's a trade-off. An alternative solution would be to put these files somewhere else.

-- robin
Previous: Junio C HamanoNext: Robin Rosenberg
Message 9 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.