7

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?

Don MacAskill
  • 868
  • 1
  • 7
  • 14

1 Answers1

1

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:

  1. Can bzr ignore empty lines when comparing revisions?

  2. Extending a version control system with custom delta algorithm

Community
  • 1
  • 1
AmanicA
  • 4,659
  • 1
  • 34
  • 49