开发者

What are the benefits of non-unified diffs?

I know that diff has other output modes than unified 开发者_开发技巧context, but I never use them. What are they and what are they useful for?


  • the plain old diff without any context has the advantage of its default: no context. basically this is useful when you want to patch files where you know in advance that the context will be changed but where line numbers are respected

  • the context diff is tighter than the unified diff, because for unified diff the patch production code must choose the context line from old or new side and make the assumption that the context is equal... though because of "ignore blanks at start/middle/end of lines"you and so on, lines of context might just be equivalent. Context diff are thus easier to apply, you don't have to specify any "ignore" option and are still sure it will apply. what it is useful for? when you have a clever soft which is able to ignore (complex) insignificant text: the patcher might not be as powerful

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜