Ignore known differences

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
boris_kaminer
New Member
Posts: 7
Joined: Thu Feb 11, 2010 12:35 am

Ignore known differences

Post by boris_kaminer »

Hi all,

I have huge number of known differences what I'd like to ignore in comparision. These differences I can specify as pairs <substring for left panel> and <substring for right panel>.

Is it possible to feed these pairs to ExamDiffPro or may be there is another way to ignore them?

/Boris
AlexL
Expert Member
Posts: 129
Joined: Wed Aug 11, 2004 6:25 am
Location: Israel
Contact:

Re: Ignore known differences

Post by AlexL »

If the patterns are different, you can specify both of them in

Code: Select all

  View->
    Options...->
      Compare->
        Parts matching regular expression
(of course following the RegExp rules).

If the number of such patterns is "huge", maybe you would like to find a way to use some regular expressions that will unite at least some of the differences to "families" (to write less in options).
boris_kaminer
New Member
Posts: 7
Joined: Thu Feb 11, 2010 12:35 am

Re: Ignore known differences

Post by boris_kaminer »

Thank you for the answer, but the advised way cannot solve the problem.

Lets give an example:

differences left: ReqNewOrder, right: CreateOrderReq

left line: .... processReqNewOrder(ReqNewOrder *req, ...)
right line: .... processCreateOrderReq(CreateOrderReq *req, ...)
ExamDiffPro: lines are equal.

left line: .... processReqNewOrder(ReqNewOrder *req, ...)
right line: .... processCancelOrderReq(CancelOrderReq *req, ...)
ExamDiffPro: lines are different.

So, we ignore differences not parts of lines.
AlexL
Expert Member
Posts: 129
Joined: Wed Aug 11, 2004 6:25 am
Location: Israel
Contact:

Re: Ignore known differences

Post by AlexL »

boris_kaminer wrote:Thank you for the answer, but the advised way cannot solve the problem.

Lets give an example:

differences left: ReqNewOrder, right: CreateOrderReq

left line: .... processReqNewOrder(ReqNewOrder *req, ...)
right line: .... processCreateOrderReq(CreateOrderReq *req, ...)
ExamDiffPro: lines are equal.

left line: .... processReqNewOrder(ReqNewOrder *req, ...)
right line: .... processCancelOrderReq(CancelOrderReq *req, ...)
ExamDiffPro: lines are different.

So, we ignore differences not parts of lines.
When you write that "lines are equal" and "lines are different", do you mean that they are equal and different according to what you want (thus confirming that you got the desired result), or you mean that they are equal and different opposite to what you want (in which case would be nice to know what you wanted to happen)?
In other words, would be helpful if you specify what is wrong.
Also, could you specify the Regular Expression pattern, which you used in options (in "Lines matching regular expression" and in "Parts matching regular expression"), and all other "Ignore" options as well?
boris_kaminer
New Member
Posts: 7
Joined: Thu Feb 11, 2010 12:35 am

Re: Ignore known differences

Post by boris_kaminer »

When you write that "lines are equal" and "lines are different", do you mean that they are equal and different according to what you want (thus confirming that you got the desired result), or you mean that they are equal and different opposite to what you want (in which case would be nice to know what you wanted to happen)?
In other words, would be helpful if you specify what is wrong.
Also, could you specify the Regular Expression pattern, which you used in options (in "Lines matching regular expression" and in "Parts matching regular expression"), and all other "Ignore" options as well?
Sorry, I was unclear. I meant desired behaviour of ExamDiffPro.

In the example it was assumed that lines are the same but differences I shown in them.

"lines are equal" means that ExamDiffPro would treat them as if they didn't have any difference
"lines are different" means that ExamDiffPro would treat them as different, showing differences and so on.

I haven't used "Ignore" filters of ExamDiffPro to filter these differences out because it is just impossible.

Looks like this is a feature request.
AlexL
Expert Member
Posts: 129
Joined: Wed Aug 11, 2004 6:25 am
Location: Israel
Contact:

Re: Ignore known differences

Post by AlexL »

If you turn ON the option "Parts matching regular expression", and insert there

Code: Select all

(ReqNewOrder)|(CreateOrderReq)
you will get first line identical, and second line different (from totally two lines in each file). Is this what you wanted?

Another variant of the mentioned option (implies something other, but giving the same result):

Code: Select all

(New)|(Create)|(Order)|(Req)
boris_kaminer
New Member
Posts: 7
Joined: Thu Feb 11, 2010 12:35 am

Re: Ignore known differences

Post by boris_kaminer »

If you turn ON the option "Parts matching regular expression", and insert there
CODE: SELECT ALL
(ReqNewOrder)|(CreateOrderReq)
you will get first line identical, and second line different (from totally two lines in each file). Is this what you wanted?

Another variant of the mentioned option (implies something other, but giving the same result):
CODE: SELECT ALL
(New)|(Create)|(Order)|(Req)
For the example it would work as I wanted, but lets extend the example to see if Ingoring of parts of lines would handle it.

left: ReqNewOrder, right: CreateOrderReq
left: ReqOrderCancel, right: CancelOrderReq
left: ReqOrderReplace, right: ReplaceOrderReq
left: RspNewOrder, right: CreateOrderRsp
left: RspOrderCancel, right: CancelOrderRsp,
left: RspOrderReplace, right: ReplaceOrderRsp,

What I should write in "Parts matching regular expression" to make ExamDiffPro treat lefts and rights in the pairs as if they were equal?
AlexL
Expert Member
Posts: 129
Joined: Wed Aug 11, 2004 6:25 am
Location: Israel
Contact:

Re: Ignore known differences

Post by AlexL »

If I understood you right, you gave 8 lines (2 in the previous email, and 6 in the latest email), where only second line from the first email should be different, while all other seven lines should be equal:
First file:

Code: Select all

processReqNewOrder(ReqNewOrder *req, ...)
processReqNewOrder(ReqNewOrder *req, ...)

ReqNewOrder
ReqOrderCancel
ReqOrderReplace
RspNewOrder
RspOrderCancel
RspOrderReplace
Second file:

Code: Select all

processCreateOrderReq(CreateOrderReq *req, ...)
processCancelOrderReq(CancelOrderReq *req, ...)

CreateOrderReq
CancelOrderReq
ReplaceOrderReq
CreateOrderRsp
CancelOrderRsp
ReplaceOrderRsp
In this case the following RegExp works:

Code: Select all

(New)|(Create)|(Order)|(Req)|(Rsp)
boris_kaminer
New Member
Posts: 7
Joined: Thu Feb 11, 2010 12:35 am

Re: Ignore known differences

Post by boris_kaminer »

Thank you, this is very interesting way.

But it has a problem, it ignores specified substrings in any occurrence that could result in missing real changes what is not desirable.

However, as fast solution it helps a lot.

Do you know if there is a way to implement desired behaviour exactly (using plugin may be?)
AlexL
Expert Member
Posts: 129
Joined: Wed Aug 11, 2004 6:25 am
Location: Israel
Contact:

Re: Ignore known differences

Post by AlexL »

Well, in order to give the exact answer, we should have the exact definition of the problem. I still feel that I don't know it.

And of course, you can write some script in Perl (or use any other way to create script or executable) and declare it as a plugin in EDP. There are also several pre-written plugins.

By the way, complicated comparing of files is almost always specific problem (specific to the private case). There are very rare occasions (if at all) when you can give general answer.
boris_kaminer
New Member
Posts: 7
Joined: Thu Feb 11, 2010 12:35 am

Re: Ignore known differences

Post by boris_kaminer »

Our problem is merging changes between branches of source code where one (or more) of the branches was refactored with huge number of renames
AlexL
Expert Member
Posts: 129
Joined: Wed Aug 11, 2004 6:25 am
Location: Israel
Contact:

Re: Ignore known differences

Post by AlexL »

boris_kaminer wrote:Our problem is merging changes between branches of source code where one (or more) of the branches was refactored with huge number of renames
Of course, but this is generalized definition (without details), not exact definition. Exact and detailed definition implies knowledge of all possible differences in all possible cases, and knowledge of required behaviour of EDP in all such cases.

By the way, exact definition may use wild cards too.
Post Reply