(too old to reply)
ediff-merge ancestor refinement
Dave Abrahams
2011-07-14 20:09:08 UTC
Hi,

When I'm doing an ediff-merge, it shows refinement regions of A
with-respect-to B. But what I'm *really* interested in, when I have a
conflict, is to see the difference between each of the final buffers and
their ancestor. For example, I had to resolve this merge conflict today:

<<<<<<< variant A
if (ActiveBlocks.size() > AddedTo) {
ArrayRef<unsigned> Add(&ActiveBlocks[AddedTo],
ActiveBlocks.size() - AddedTo);
addThroughConstraints(Intf, Add);
variant B
if (ActiveBlocks.size() == AddedTo)
break;
addThroughConstraints(Cand.Intf,
ArrayRef<unsigned>(ActiveBlocks).slice(AddedTo));
####### Ancestor
if (ActiveBlocks.size() == AddedTo)
break;
addThroughConstraints(Intf,
ArrayRef<unsigned>(ActiveBlocks).slice(AddedTo));
======= end

If you look really carefully, you can see that variant B added "Cand."
in the 3rd line. But it was really hard for me to see that. Once I did
see it, the merge was trivial. Wouldn't it be possible to highlight
diffs in A and B with-respect-to the Ancestor buffer?

Hmm, I see we have a face for something like that:

,----
| Face: ediff-fine-diff-Ancestor
|
| Documentation:
| Face for highlighting the refinement of the selected diff in the ancestor buffer.
| At present, this face is not used and no fine differences are computed for the
| ancestor buffer.
`----

Is this especially hard to code or something?
--
Dave Abrahams
BoostPro Computing
http://www.boostpro.com
Stefan Monnier
2011-07-16 16:09:10 UTC
Post by Dave Abrahams
When I'm doing an ediff-merge, it shows refinement regions of A
with-respect-to B. But what I'm *really* interested in, when I have a
conflict, is to see the difference between each of the final buffers and
<<<<<<< variant A
if (ActiveBlocks.size() > AddedTo) {
ArrayRef<unsigned> Add(&ActiveBlocks[AddedTo],
ActiveBlocks.size() - AddedTo);
addThroughConstraints(Intf, Add);
variant B
if (ActiveBlocks.size() == AddedTo)
break;
addThroughConstraints(Cand.Intf,
ArrayRef<unsigned>(ActiveBlocks).slice(AddedTo));
####### Ancestor
if (ActiveBlocks.size() == AddedTo)
break;
addThroughConstraints(Intf,
ArrayRef<unsigned>(ActiveBlocks).slice(AddedTo));
======= end
If you change the above markers to the standard diff3 markers, you can
use smerge-mode (a minor mode, much more lightweight than ediff3) which
lets you highlight refined changed between any two of the 3 chunks.


Stefan
Andreas Röhler
2011-07-17 09:03:45 UTC
Post by Dave Abrahams
Hi,
When I'm doing an ediff-merge, it shows refinement regions of A
with-respect-to B. But what I'm *really* interested in, when I have a
conflict, is to see the difference between each of the final buffers and
<<<<<<< variant A
if (ActiveBlocks.size()> AddedTo) {
ArrayRef<unsigned> Add(&ActiveBlocks[AddedTo],
ActiveBlocks.size() - AddedTo);
addThroughConstraints(Intf, Add);
variant B
if (ActiveBlocks.size() == AddedTo)
break;
addThroughConstraints(Cand.Intf,
ArrayRef<unsigned>(ActiveBlocks).slice(AddedTo));
####### Ancestor
if (ActiveBlocks.size() == AddedTo)
break;
addThroughConstraints(Intf,
ArrayRef<unsigned>(ActiveBlocks).slice(AddedTo));
======= end
If you look really carefully, you can see that variant B added "Cand."
in the 3rd line. But it was really hard for me to see that. Once I did
see it, the merge was trivial. Wouldn't it be possible to highlight
diffs in A and B with-respect-to the Ancestor buffer?
,----
| Face: ediff-fine-diff-Ancestor
|
| Face for highlighting the refinement of the selected diff in the ancestor buffer.
| At present, this face is not used and no fine differences are computed for the
| ancestor buffer.
`----
Is this especially hard to code or something?
Hi,

reads like a useful request for me. But wrong list. Either a bug report
or sending it to emacs-devel seems TRT.

Thanks,

Andreas