开发者

Is there a file diff tool that allows for exceptions?

We currently use Beyond Compare 3.0 and I am quite pleased with it. However, it would be great if I could easily specify an exclusion for a specific one-time case. This is needed when I am doing a code review of some refactoring. For instance:

Old code

doSomething(ConstantsInterface.FOOBAR);

New code:

doSomething(BetterEnumeration.FOOBAR);

In this case, I have hundreds of changes that I am reviewing that are essentially all the same exact change and I just want to see the exceptions. It would be great if I could easily specify an exception that indicates these two开发者_StackOverflow社区 cases are equal. I know of a way to do it in the grammar, but it is tedious and cumbersome in the case where there are ten or so exceptions.

Any other tips?


Beyond Compare's Pro edition supports ignoring renamed identifiers. It's covered in the help here, and there's a video demonstration of it here. It's not limited to just identifiers either; it can handle things like i=i+1 => i++. If you have a recent version installed you can just right click on the difference and select "Replacement..." to get started.


1) Write one line regex to switch them all back.

2) Diff, see any exceptions

3) Run reverse of regex in step 1

Done in 5 minutes

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜