为什么将带有尾随空格的行提交到源代码管理中是不好的? [英] Why is it bad to commit lines with trailing whitespace into source control?

查看:18
本文介绍了为什么将带有尾随空格的行提交到源代码管理中是不好的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么将带有尾随空格的行检查到源代码管理中会很糟糕?这会导致什么样的问题?

Why is it bad to check in lines with trailing whitespace to your source control? What kinds of problems could that cause?

推荐答案

基本上是错误的差异.如果差异只显示真实"的变化,这会很有帮助.一些 diff 程序会忽略空格,但最好首先避免虚拟更改.

False differences, basically. It's helpful if diffs only show "real" changes. Some diff programs will ignore whitespace, but it would be better just to avoid the dummy change in the first place.

当然,如果它在同事的机器上绕线也无济于事.

Of course, it also doesn't help if it makes the line wrap on a colleague's machine.

这篇关于为什么将带有尾随空格的行提交到源代码管理中是不好的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆