审核变更是一项繁琐的工作。审查代码更改更加繁琐。当代码更改与缩进变化混合时,很多人都会放弃。
我正在谈论这样的事情:
- public myMethod(String message, boolean log)
- {
+ public myMethod(String message, boolean log) {
发布了一个git开发环境,您可以启动一个简单的测试来尝试现有选项来过滤那些无关的更改:
echo "hi world!" > file1
echo "hi world!" > file2
git diff file1 file2 #show a difference with spaces
git diff -w file1 file2 #show there is no real diff (no output, cool!)
git diff -b file1 file2 #same, no real diff
echo -e "hi\nworld!" > file3
git diff file1 file3 #there is a diff
git diff -w file1 file3 # again a diff
git diff --patience file1 file3 #no luck to hide this diff
git diff --minimal file1 file3 #neither
git diff --word-diff file1 file3 #almost! a chunk showing... no diff
git diff --word-diff file3 file1 #same with final file contents from file1
这表明--word-diff几乎完成了工作,但无论如何都会显示有变化的块,有没有机会隐藏它们?请参见-b或-w完全隐藏其过滤后的更改。
我知道新行可以改变代码中的语义,但由于我在讨论审阅而不是合并,所以这不应该是一个需要关注的问题。
到目前为止,我一直在使用filter-word-diff污染我的差异,然后再去看看。