On Mon, Mar 5, 2012 at 3:47 PM, Richard Hipp <d...@sqlite.org> wrote: > > > On Mon, Mar 5, 2012 at 8:29 AM, Emil Totev <em...@tot-consult.com> wrote: >> >> Hi >> >> This is fossil version 1.21 [002580c50d] 2011-12-13 13:53:56 UTC >> on Windows 7 SP1 >> >> I have configured winmerge as my gdiff-command and it works fine for me >> with `fossil gdiff`, however it doesn't work with `fossil stash gdiff`. >> Winmerge starts with an empty screen for each modified file. >> >> It seems the program is started with parameters like >> "/temp/xDjd8RXRlXyBTEo /temp/RgKiAnjkXUrB61Z", and I can see some temporary >> files like this created, but obviously winmerge cannot pick them up. >> >> Some things I don't understand: >> >> -- why '/temp' on Windows? Obviuosly this does not use an environment >> variable. I have such a directory, but what if I hadn't? > > > See http://www.fossil-scm.org/fossil/artifact/3e15b2476f1e?ln=861-903 for > the current algorithm for finding temporary filenames. How would you > suggest that this code be improved? >
Well, this should definitely be platform-specific. On Windows, the temporary files should be created in the directory pointed by the following environment variables (in this order): TMP TEMP USERPROFILE or in the Windows system directory. There is an API function GetTempPath(), or even better - GetTempFileName(). http://msdn.microsoft.com/en-us/library/windows/desktop/aa364991(v=vs.85).aspx >> >> >> -- why two temporary files compared with one another? I was expecting only >> the file from the stash to be temporary and to be able to selectively move >> some of the changes to the working copy of the file. > > > Stash loads both files into memory expected to do an internal diff. Only > then does it realize that you want to use an external program, and so at > that point it writes them both out to disk against so that the external > program can access them. This might not be the most efficient, but it is > simple to implement because it involves fewer special cases. Is this really > something important that needs to be optimized? > Well, this depends on the way people are using it. In my case, I tend to use `gdiff` with winmerge to also merge differences. I can make multiple unrelated changes at the same time, then stash them amd start merging back into the latest version in related groups. Maybe this is what `gmerge` is supposed to do, I didn't check it, but then there is no `stash gmerge` anyway. My expectations were that `stash gdiff ` would work like the regular `gdiff` and allow to change the working copy. Other should also step in to say if this is really something important that needs to be optimised. regards Emil _______________________________________________ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users