I understand how KDiff3 is useful for version control, where there is a single source stream, but I often need to maintain multiple source streams, where the streams have diverged and must remain so. However, when I make changes to one stream, I often need to make those same changes, or very similar changes to another stream.
I can use KDiff3 to do an A/B (base/modified) comparison in one stream, then for each delta, copy the text, switch windows to an editor holding the corresponding file from another stream, paste the text, then switch back to do the next delta. Is there any easier way to do that with KDiff3?
I guess what I'm looking for, is some way to have KDiff3 only show the differences between files A and B, but then edit a third file C in KDiff3's merge editor. Is there any option to do that?
Thanks,
Elle
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Usually a 3-way merge would work, using a common base as A and the current versions in B and C.
Yet if the common base is too old you'll have difficulties keeping changes that only belong on one side there.
Still a 3-way comparison/merge would give you a good idea what happened on either side. I would recommend using the merge menu to choose all changes from your preferred side and take in only those improvements you want.
Joachim
Last edit: Joachim Eibl 2013-01-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Reconciling multiple source streams is pretty much a fact of life around here, so I'm astounded that other people haven't run into the same kinds of issues.
In most cases the differing source streams represent different products, some of which diverged more than a decade ago. While an update may include a few hundred deltas, there are typically many thousands of deltas between source streams, making it impossible to pick out the required updates from a 3-way comparison. So I'll keep doing what I've been doing.
Elle
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I admit that multiple source streams is not uncommon. But things can become very complicated when the common base is a long way in the past.
If the sources are still close enough and you can tell in which version you started with the changes that you want to use in the other stream, then you can use the version without these changes as base (A). KDiff3 can help you to move the delta between A and B to C.
With S1(n) = Stream 1 with version n, S2 = Stream 2
S1(n) before changes: use as base A.
S1(n+N) with changes: use as B.
S2(m): use as C, save target as S2(m+1).
This will work in both directions if you swap S1 and S2.
But as you point out, you reject or change some lines from S1.
When merging back from S2 to S1 your base should be S2(m+1) or newer. Otherwise if you use S2(k) (with k<=m) as base when merging back then items you rejected during the first merge will be deleted from S1 too.
This is a standard problem when working with several streams.
Joachim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think that you're over-complicating things. If you look at my original post, you'll see that all that I was looking for is some way to use the KDiff3 merge editor on a second stream. Sometimes the best algorithms are symbiotic ones, where the silicon computer and the two legged variety each have their own parts to do.
I'm not looking for you to do anything about this. I just thought that perhaps I was missing something.
Elle
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok. I think I misunderstood your original question and was carried away.
On reading your original question again I figure that you are just looking for an integrated editor?
Do a merge (even for two files only) then the merge output editor will appear on the lower part of the window. There you can edit and for any delta choose either A or B. You might want to start by choosing either A or B for all deltas via the menu "Merge".
Also see the documentation.
Joachim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Joachim, were still not on the same sheet of music.
You have described a 2-way merge, but that only succeeds in modifying either file A or file B. Instead, the idea is to generate deltas between files A and B only, but use KDiff3's merge editor modify a third file C. In this scenario, file C is so disparate from files A and B, that any comparison between C and the other files is guaranteed to generate a plethora of spurious deltas. The deltas are spurious in the sense that they serve no purpose in attempting to merge the deltas between files A and B into file C. In fact any deltas involving file C simply hinder the reconciliation process.
Earlier I attempted to attach some screen prints that would better describe this process, but my posting was apparently rejected. Is it possible to attach a .png file to a posting on this forum?
Elle
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Attaching a small image worked for me. But using the tip from the "Formatting Help" didn't seem to work. Only the "alt" text appeared where I wrote:
[[img src=hi32-app-kdiff3.png alt=KDiff3]]
Regarding your question: You want to completely exclude your file "C" from the diff-step but you want to edit it. This is currently not possible.
The thing that comes closest is to use your file as third file in the merge and then "choose C everywhere" via the merge menu and hide the C-view by dragging the splitter. But I agree that the diff between A and B might become stretched a bit where lines from C would be.
Joachim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I understand how KDiff3 is useful for version control, where there is a single source stream, but I often need to maintain multiple source streams, where the streams have diverged and must remain so. However, when I make changes to one stream, I often need to make those same changes, or very similar changes to another stream.
I can use KDiff3 to do an A/B (base/modified) comparison in one stream, then for each delta, copy the text, switch windows to an editor holding the corresponding file from another stream, paste the text, then switch back to do the next delta. Is there any easier way to do that with KDiff3?
I guess what I'm looking for, is some way to have KDiff3 only show the differences between files A and B, but then edit a third file C in KDiff3's merge editor. Is there any option to do that?
Thanks,
Elle
Usually a 3-way merge would work, using a common base as A and the current versions in B and C.
Yet if the common base is too old you'll have difficulties keeping changes that only belong on one side there.
Still a 3-way comparison/merge would give you a good idea what happened on either side. I would recommend using the merge menu to choose all changes from your preferred side and take in only those improvements you want.
Joachim
Last edit: Joachim Eibl 2013-01-28
Thanks Joachim,
Reconciling multiple source streams is pretty much a fact of life around here, so I'm astounded that other people haven't run into the same kinds of issues.
In most cases the differing source streams represent different products, some of which diverged more than a decade ago. While an update may include a few hundred deltas, there are typically many thousands of deltas between source streams, making it impossible to pick out the required updates from a 3-way comparison. So I'll keep doing what I've been doing.
Elle
Hi Elle,
I admit that multiple source streams is not uncommon. But things can become very complicated when the common base is a long way in the past.
If the sources are still close enough and you can tell in which version you started with the changes that you want to use in the other stream, then you can use the version without these changes as base (A). KDiff3 can help you to move the delta between A and B to C.
With S1(n) = Stream 1 with version n, S2 = Stream 2
S1(n) before changes: use as base A.
S1(n+N) with changes: use as B.
S2(m): use as C, save target as S2(m+1).
This will work in both directions if you swap S1 and S2.
But as you point out, you reject or change some lines from S1.
When merging back from S2 to S1 your base should be S2(m+1) or newer. Otherwise if you use S2(k) (with k<=m) as base when merging back then items you rejected during the first merge will be deleted from S1 too.
This is a standard problem when working with several streams.
Joachim
Thanks again Joachim,
I think that you're over-complicating things. If you look at my original post, you'll see that all that I was looking for is some way to use the KDiff3 merge editor on a second stream. Sometimes the best algorithms are symbiotic ones, where the silicon computer and the two legged variety each have their own parts to do.
I'm not looking for you to do anything about this. I just thought that perhaps I was missing something.
Elle
Ok. I think I misunderstood your original question and was carried away.
On reading your original question again I figure that you are just looking for an integrated editor?
Do a merge (even for two files only) then the merge output editor will appear on the lower part of the window. There you can edit and for any delta choose either A or B. You might want to start by choosing either A or B for all deltas via the menu "Merge".
Also see the documentation.
Joachim
Joachim, were still not on the same sheet of music.
You have described a 2-way merge, but that only succeeds in modifying either file A or file B. Instead, the idea is to generate deltas between files A and B only, but use KDiff3's merge editor modify a third file C. In this scenario, file C is so disparate from files A and B, that any comparison between C and the other files is guaranteed to generate a plethora of spurious deltas. The deltas are spurious in the sense that they serve no purpose in attempting to merge the deltas between files A and B into file C. In fact any deltas involving file C simply hinder the reconciliation process.
Earlier I attempted to attach some screen prints that would better describe this process, but my posting was apparently rejected. Is it possible to attach a .png file to a posting on this forum?
Elle
Test for attached image:

Attaching a small image worked for me. But using the tip from the "Formatting Help" didn't seem to work. Only the "alt" text appeared where I wrote:
Regarding your question: You want to completely exclude your file "C" from the diff-step but you want to edit it. This is currently not possible.
The thing that comes closest is to use your file as third file in the merge and then "choose C everywhere" via the merge menu and hide the C-view by dragging the splitter. But I agree that the diff between A and B might become stretched a bit where lines from C would be.
Joachim
Thanks Joachim. Enough said.
Elle