Controlling manual alignment in 'Beyond Compare's 3-way merge
Asked Answered
T

0

11

When doing a 3-way merge in 'Beyond Compare', we can get the following misalignment due to code similarity (The X's are the deleted code segments, and only two files are shown):

/*                         XXXXXXXXXXXXXXXXX 
somefunc()                 somefunc()   <---2
{                          {
body                       body
...                        ... 
}                          }
*/                         XXXXXXXXXXXXXXXXX 
somefunc()   <---1         XXXXXXXXXXXXXXXXX
{                          XXXXXXXXXXXXXXXXX
modified body              XXXXXXXXXXXXXXXXX  
...                        XXXXXXXXXXXXXXXXX
}                          XXXXXXXXXXXXXXXXX
...next segment            ...next segment

The desired alignment is as follows:

/*                         XXXXXXXXXXXXXXXXX 
somefunc()                 XXXXXXXXXXXXXXXXX  
{                          XXXXXXXXXXXXXXXXX
body                       XXXXXXXXXXXXXXXXX
...                        XXXXXXXXXXXXXXXXX
}                          XXXXXXXXXXXXXXXXX
*/                         XXXXXXXXXXXXXXXXX 
somefunc()                 somefunc()  
{                          {           
modified body              body
...                        ...    
}                          }           
...next segment            ...next segment

So I do a manual alignment between position-2 and position-1, and what I actually get is:

/*                         XXXXXXXXXXXXXXXXX 
somefunc()                 XXXXXXXXXXXXXXXXX  
{                          XXXXXXXXXXXXXXXXX
body                       XXXXXXXXXXXXXXXXX
...                        XXXXXXXXXXXXXXXXX
}                          XXXXXXXXXXXXXXXXX
*/                         XXXXXXXXXXXXXXXXX 
somefunc()                 somefunc()  
XXXXXXXXXXXXXXXXX          {           
XXXXXXXXXXXXXXXXX          body
XXXXXXXXXXXXXXXXX          ...    
XXXXXXXXXXXXXXXXX          }           
{                          XXXXXXXXXXXXXXXXX                        
modified body              XXXXXXXXXXXXXXXXX
...                        XXXXXXXXXXXXXXXXX
}                          XXXXXXXXXXXXXXXXX
...next segment            ...next segment

So it manages to do the alignment on a single line, but then it shifts the rest of code down.

How can we use manual alignment to get the desired outcome? Changing settings to modify alignment parameters doesn't achieve the desired outcome either. (Also note: body and modified body are very similar, so the match can't be missed)

Their is a posting on their forum here that mentions individual line by line alignment, but that would be very tedious for longer sections.

Edit: If said alignment is not possible in current version, is it then possible to disable the automatically synchronized scrolling of the input and output editor panes, so that unaligned code sections can be viewed by the user simultaneously. These sections would be unaligned by the program, but would be considered aligned from the user's point of view.

Thermy answered 30/5, 2012 at 7:5 Comment(1)
Apparently, this is something Beyond Compare still cannot do over 10 years later!Conspiracy

© 2022 - 2024 — McMap. All rights reserved.