winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

Add an option to disable *.bak file creation via command line arguments

Open lawrence-laz opened this issue 2 years ago • 1 comments

By default winmerge creates *.bak files when comparing two files.

This creates friction when adopting snaphot testing libraries, such as Verify, which open winmerge automatically when a test fails with "verified" and "received" files. The *.bak files match the name pattern and are picked up by the testing library as one of the inputs. This makes test fails until the *.bak file is manually deleted.

Related discussion here.

If winmerge provided an argument to disable backups via something like /disable-backup, this could be incorporated into testing libraries to make winmerge act as expected out of the box.

lawrence-laz avatar Apr 14 '23 20:04 lawrence-laz

You can disable file backup when starting using the /cfg command-line option as shown below, although it is not documented.

"c:\Program Files\WinMerge\WinMergeU.exe" /cfg Backup/EnableFile=0

However, specifying as above will also overwrite the current settings. If you do not want that, you can use the /inifile command-line option as shown below to save the configuration information to an INI file instead of the registry.

"c:\Program Files\WinMerge\WinMergeU.exe" /cfg Backup/EnableFile=0 /inifile "%userprofile%\wm.ini"

sdottaka avatar Apr 15 '23 00:04 sdottaka