How can I ignore eol changes and all white space in svn?

给你一囗甜甜゛ 提交于 2019-12-03 06:20:44

问题


Combining svn diff --ignore-eol-style and --ignore-all-space is not working:

$ svn diff -x -w --ignore-eol-style -r 1143:1177 somefile
svn: invalid option: --ignore-eol-style

And,

$ svn diff -x --ignore-eol-style -x --ignore-all-space -r 1143:1177 somefile

Only executes the last option: ignore-all-space

Anybody dealt with this before?


回答1:


The svn command seems to honour only one -x option. This means, you must/can combine all options into one argument:

    svn diff -x "-w --ignore-eol-style"

I did not test whether this is also true for external diff-tools.




回答2:


You can use external differencing tool with appropriate options (diff-cmd option in SVN config). Check this. Then you have freedom to set any diff tool and provide arguments to it. You can also use it directly:

svn diff --diff-cmd /usr/bin/diff --extensions "-b" -r 1143:1177 somefile

where -b to ignore white space at line end and consider all other sequences of one or more white space characters to be equivalent,



来源:https://stackoverflow.com/questions/7449503/how-can-i-ignore-eol-changes-and-all-white-space-in-svn

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!