Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wimerge saves changes to the wrong file #1985

Closed
IainCrampton opened this issue Aug 15, 2023 · 5 comments
Closed

Wimerge saves changes to the wrong file #1985

IainCrampton opened this issue Aug 15, 2023 · 5 comments

Comments

@IainCrampton
Copy link

winmerge: Version 2.16.32.0 x64, OS: Windows 11 Enterprise 22H2
I compare two source code folders (large projects with many files/subfolders)
I open a file (in the vvideo example p136.c) and compare the two versions of that file and leave the tab open,
I open another file (bridge.cpp) and compare the two versions of that file
I copy a change from the right to left file in the bridge.cpp and save using Ctrl+S or Alt+F+S
Instead of saving the changes to bridge.cpp, p136.c (file in tab 1) is overwritten with a copy of bridge.cpp (file from tab2)
Any subsequent file opened doesthe same thing - looks OK until you save changes, then the left file becomes the file from the first tab opened.
If I restart Winmerge it behaves properly for a while then starts doing the same thing again sometime later.

Video: https://epsusllc-my.sharepoint.com/:v:/g/personal/iain_crampton_epssw_com/EfHulHXWGjlEh0XbdOnZjQ4BXvHarr3TYlPd65wvvY9_zA?e=dth5Zs

@sdottaka
Copy link
Member

How did you open the file p136.c?

This can happen if you open the p136.c file with the command line option /o as follows: The command line option /o is an option to change the destination of the specified file.

"c:\program files\winmerge\winmergeu.exe" file1 file2 /o p136.c

@IainCrampton
Copy link
Author

@sdottaka As far as a I recall I opened it from a taskbar shortcut. I suppose it is possible I re-used an open copy that originally started from looking at a diff in tortoise it, but it was a new folder comparison. I don't know if tortoise git uses the /o option in the background ever. I didn't use the comand line myself,.

@sdottaka
Copy link
Member

If you start WinMerge from TortoiseGit to resolve conflicts, the /o option will be used, so if you reuse the WinMerge window started from TortoiseGit without closing it, the problem you pointed out will occur.
Of course, this behavior is problematic and needs improvement.

@IainCrampton
Copy link
Author

@sdottaka in that case I suppose it is not a bug as such and we can close this issue. My suggestion for improvement would be that if Winmerge is started with /o option, then when the user opens a new tab (or starts a new file or folder comparison) the user is warned that this option is in effect and given the option to cancel it. Thanks for your help :-)

@sdottaka
Copy link
Member

With PR #1988, the /o command line option no longer affects tabs other than those opened with this option.

@sdottaka sdottaka added this to the v2.16.33 milestone Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants