How do I get KDiff3 to auto merge with no UI?
Asked Answered
J

1

9

How do I get KDiff3 to automatically do a 3-way merge such that it shows no UI? Ideally, if it succeeds, it returns success, and if it can't (it needs manual merging), it returns an error code.

Everything I've read seems to imply that the following should work:

"c:\Program Files\KDiff3\kdiff3.exe" --auto base.txt src.txt tar.txt -o merge.txt

However, it doesn't. When I run it, a message box pops up that says:

Total number of conflicts: 3
Nr of automatically solved conflicts: 3
Nr of unsolved conflicts: 0

How do I get it to run without this popup, and no GUI at all if it fails?

Jorge answered 7/2, 2019 at 2:37 Comment(0)
J
7

I figured it out. I need to add a "--cs" and "ShowInfoDialogs=0" to the command line. So this:

"c:\Program Files\KDiff3\kdiff3.exe" --auto base.txt src.txt tar.txt -o merge.txt

...becomes this:

"c:\Program Files\KDiff3\kdiff3.exe" --auto base.txt src.txt tar.txt -o merge.txt --cs "ShowInfoDialogs=0"

...and now it works.

Jorge answered 17/2, 2019 at 17:8 Comment(2)
Note that the --cs option is unfortunately persistent. So the next time you run KDiff3 interactively it will no longer show those dialogs either - seems bad. kdiff3.sourceforge.net/doc/documentation.html "The option --cs allows you to adjust a configuration value that is otherwise only adjustable via the configure dialogs. But be aware that when KDiff3 then terminates the changed value will be stored along with the other settings. With --confighelp you can find out the names of the available items and current values."Insubordinate
Ok, but then I wonder what "--auto" really means. > --auto No GUI if all conflicts are auto-solvable. (Needs -o file) Is GUI here not including the popup InfoDialogs ?Perseid

© 2022 - 2024 — McMap. All rights reserved.