Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 442
spongyryno Avatar asked Feb 07 '19 02:02

spongyryno


People also ask

How do I merge KDiff3?

KDiff3 offers automatic merge for these items at Merge item in the settings dialog. For simple lines that match the Auto merge regular expression option in all input-files KDiff3 will choose the line from B or - if available - from C.

How does KDiff3 work?

KDiff3 is a file and directory diff and merge tool which compares and merges two or three text input files or directories, shows the differences line by line and character by character(!), provides an automatic merge-facility, has an editor for comfortable solving of merge-conflicts, provides networktransparency via ...

What is base local remote in KDiff3?

It is the first common ancestor. Often it is useful to have this to help decide which of the newer commits you want. Local is your local commit, the one in the current branch you are standing on. Remote is the remote commit, of the branch you are merging into your local one.


1 Answers

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.

like image 101
spongyryno Avatar answered Nov 15 '22 00:11

spongyryno