如何在使用svn diff时获得无上下文 [英] How to get NO context when using svn diff
问题描述
当我从命令行使用'svn diff'时,它打印出已经改变的行,而且打印出上下文之前和之后的3个不变的行。我更喜欢只看到没有上下文的改变的线。我没有能够确定任何命令行选项,将让我做这样的行为。标准的'diff'和'cvs diff'默认做我想要的。当然'svn diff'可以做到这一点,但我错过了一些东西。任何人知道如何?
When I use 'svn diff' from the command line, it prints out the lines that have changed but also the 3 unchanged lines before and after for context. I much prefer seeing only the changed lines with no context. I haven't been able to determine any command line options that will let me make it behave this way. Standard 'diff' and 'cvs diff' do what I want by default. Surely 'svn diff' can do this but I'm missing something. Anyone know how?
推荐答案
通过放松查看上面给出的有用的链接,简短的回答是svn的内置diff不能做我想要的。你可以告诉它使用标准的外部diff,并通过arg来告诉它你不想要上下文。我把以下别名放在我的.bashrc中,现在所有现在都可以正常工作,如果我改用:
After looking into the useful link given above by unwind, the short answer is that svn's built-in diff can't do what I want. You can tell it to use the standard external diff though and pass arg's to that to tell it that you want no context. I put the following alias in my .bashrc and all now works well if I use that instead:
alias svndiff='svn diff --diff-cmd=diff -x -U0'
这篇关于如何在使用svn diff时获得无上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!