winmerge
winmerge copied to clipboard
Order comparison panes from left to right based on file modification date with oldest on left
When using the Windows Explorer context menu to select two files, right-click to bring up the context menu, and open in WinMerge, I frequently have to use the View / Swap Panes functions to show the original file in the left pane and the changed file on the right. This is the natural flow of viewing before/after changes to the files.
As Windows Explorer seems to pass filename arguments in a random order when opened from the context menu, WinMerge should try to determine which is the original file and display it in the left pane. In most cases, the file with the oldest modified timestamp is most likely the original, and should be displayed in the left pane. If that happens to be incorrect, the user can perform the Swap Panes function, however checking the modified date would probably result in the desired behavior most of the time and reduce the randomness of the file ordering.
A bonus feature could be adding a setting (possibly under Compare / General) where the user could select which sort order they prefer (oldest on left, oldest on right, or no sorting), as people may have a different preference, especially if using a right to left language/locale. The default setting could be 'oldest on left', or auto-selected based on locale/language.
This can probably apply to 3-way diff as well (all 3 panes sorted by timestamp in ascending order from left to right).
The order in which file paths are passed is not random but regular. The file you right-click will be the first file. The rest looks like the display order of Explorer.
I've tried a few times clicking on one or the other first, and you're right that Windows Explorer does seem to have a logic to it, however it's not obvious enough where I can be consistent.
I would appreciate if this could still be considered as a feature request to allow the user to choose a preferred order based on modification date, regardless of what order the files were clicked on. Oldest on the left is (probably) what most people usually want, and it would save the effort of trying to figure out which one to click first manually in the Explorer window.