git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Sixt <j6t@kdbg.org>, git@vger.kernel.org
Subject: Re: [PATCH v3] Allow the user to change the temporary file name for mergetool
Date: Wed, 20 Aug 2014 09:24:27 +0200 (CEST)	[thread overview]
Message-ID: <1933929003.2352.1408519467593.JavaMail.zimbra@dewire.com> (raw)
In-Reply-To: <xmqqk364unya.fsf@gitster.dls.corp.google.com>



----- Ursprungligt meddelande -----
> 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

  reply	other threads:[~2014-08-20  7:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19 12:22 [PATCH] Allow the user to change the temporary file name for mergetool Robin Rosenberg
2014-08-19 12:52 ` Stefan Näwe
2014-08-19 14:55   ` [PATCH v2] " Robin Rosenberg
2014-08-19 17:02     ` Junio C Hamano
2014-08-19 17:15       ` [PATCH v3] " Robin Rosenberg
2014-08-19 18:01         ` Junio C Hamano
2014-08-19 20:36         ` Johannes Sixt
2014-08-19 22:14           ` Junio C Hamano
2014-08-20  7:24             ` Robin Rosenberg [this message]
2014-08-21  7:47               ` [PATCH v4] " Robin Rosenberg
2014-08-21 20:04                 ` Junio C Hamano
2014-08-20  7:22         ` [PATCH v3] " Stefan Näwe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1933929003.2352.1408519467593.JavaMail.zimbra@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).