如何在 Bazaar (bzr merge) 中进行忽略空格的合并?
随着我们的团队和代码库不断扩大,我们看到越来越多的情况,Bazaar 坚持认为合并操作期间存在冲突,但实际上这只是一个小的空白更改 - 我们希望它默默地忽略它。
bzr diff 有 --diff-options,但 bzr merge 似乎没有类似的选项。
可能的?
As our team and codebase continue to get bigger, we're seeing more and more cases where Bazaar insists there's a conflict during a merge operation, but in reality it's just a minor whitespace change - which we'd like it to silently ignore.
bzr diff has --diff-options, but there doesn't seem to be a similar option for bzr merge.
Possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为 Bazaar 编写提供自定义合并算法的插件: http://doc.bazaar.canonical.com/development/en/user-guide/hooks.html#example-a-merge-plugin http://doc.bazaar。 canonical.com/development/en/user-reference/hooks-help.html#merge-file-content
我认为问题是当你像这样合并时,算法必须选择一侧接受。
此外,所有空格更改可能不像带引号的字符串中的空格那样微不足道。
如果可以以某种方式配置 bzr 以在合并时忽略尾随空白更改(即,当唯一的更改是尾随空白时选择左侧父级),那将非常好。
我目前处理这个问题的方法是不允许使用我的 bzr-textchecker 检查尾随空格插件,在某些时候我希望它能够自动删除尾随空格。
相关问题:
bzr 在比较修订版本时可以忽略空行吗?< /a>
使用自定义增量扩展版本控制系统算法
You can write plugins for Bazaar that provide custom merge algorithms: http://doc.bazaar.canonical.com/development/en/user-guide/hooks.html#example-a-merge-plugin http://doc.bazaar.canonical.com/development/en/user-reference/hooks-help.html#merge-file-content
I think the issue is when you merge like this the algorithm must choose one of the sides to accept.
Also all whitespace changes may not be trivial like whitespace within a quoted string.
It would be really nice if one can somehow configure bzr to ignore trailing whitespace changes when merging (i.e. pick the left-hand-parent when the only change is a trailing whitespace).
How I deal with this currently is to not allow checking in trailing white space using my bzr-textchecker plugin, at some point I'd like it to be able to automatically remove the trailing whitespace.
Related questions:
Can bzr ignore empty lines when comparing revisions?
Extending a version control system with custom delta algorithm