Subject: Re: [PATCH v2] difftool: don't overwrite modified files

From: John Keeping <[email-masked]>
Date: Tue, 26 Mar 2013 21:01:42 +0000

On Tue, Mar 26, 2013 at 04:52:02PM -0400, Matt McClure wrote:
> On Mon, Mar 25, 2013 at 5:44 PM, John Keeping <[email-masked]> wrote:
> > Instead of copying unconditionally when the files differ, create and
> > index from the working tree files and only copy the temporary file back
> > if it was modified and the working tree file was not.  If both files
> > have been modified, print a warning and exit with an error.
> 
> When there's a conflict, does difftool save both conflicting files? Or
> only the working tree copy? I think it should preserve both copies on
> disk.

It preserves both copies - the "clean the temporary directory" step is
just skipped.

This isn't ideal since the temporary copy will be under a temporary
directory somewhere but is better than the current behaviour.  It might
be nice to move the temporary file back with an extension so that the
files are at least near each other but I don't think that's needed in
the first version of this change.