Ignore known differences
-
- New Member
- Posts: 7
- Joined: Thu Feb 11, 2010 12:35 am
Ignore known differences
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
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
Re: Ignore known differences
If the patterns are different, you can specify both of them in
(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).
Code: Select all
View->
Options...->
Compare->
Parts matching regular expression
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).
-
- New Member
- Posts: 7
- Joined: Thu Feb 11, 2010 12:35 am
Re: Ignore known differences
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.
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.
Re: Ignore known differences
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)?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.
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?
-
- New Member
- Posts: 7
- Joined: Thu Feb 11, 2010 12:35 am
Re: Ignore known differences
Sorry, I was unclear. I meant desired behaviour of ExamDiffPro.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?
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.
Re: Ignore known differences
If you turn ON the option "Parts matching regular expression", and insert thereyou 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
(ReqNewOrder)|(CreateOrderReq)
Another variant of the mentioned option (implies something other, but giving the same result):
Code: Select all
(New)|(Create)|(Order)|(Req)
-
- New Member
- Posts: 7
- Joined: Thu Feb 11, 2010 12:35 am
Re: Ignore known differences
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.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)
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?
Re: Ignore known differences
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:Second file:
In this case the following RegExp works:
First file:
Code: Select all
processReqNewOrder(ReqNewOrder *req, ...)
processReqNewOrder(ReqNewOrder *req, ...)
ReqNewOrder
ReqOrderCancel
ReqOrderReplace
RspNewOrder
RspOrderCancel
RspOrderReplace
Code: Select all
processCreateOrderReq(CreateOrderReq *req, ...)
processCancelOrderReq(CancelOrderReq *req, ...)
CreateOrderReq
CancelOrderReq
ReplaceOrderReq
CreateOrderRsp
CancelOrderRsp
ReplaceOrderRsp
Code: Select all
(New)|(Create)|(Order)|(Req)|(Rsp)
-
- New Member
- Posts: 7
- Joined: Thu Feb 11, 2010 12:35 am
Re: Ignore known differences
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?)
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?)
Re: Ignore known differences
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.
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.
-
- New Member
- Posts: 7
- Joined: Thu Feb 11, 2010 12:35 am
Re: Ignore known differences
Our problem is merging changes between branches of source code where one (or more) of the branches was refactored with huge number of renames
Re: Ignore known differences
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.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
By the way, exact definition may use wild cards too.