I've been involved in an open source project called Secret M. Chronicles (SMC).
We seem to have encountered a bit of a problem with git merges:
- We have two main branches in git: release-2.0 (for an upcoming release) and devel (for development)
- The decision was made to switch all source code to the K&R formatting standard.
- The formatting was applied to devel but not release-2.0. One of the team members indicated the formatting tool could change logic even if it shouldn't, which would be unacceptable for the release-2.0 branch.
- A reasonable number of changes have been pushed to the devel branch after the formatting changes.
- Every time we merge release-2.0 into devel, the formatting changes cause every single line to show up as a conflict, requiring careful checking during merging. This increases the chance of mistakes, not to mention tedium.
- We've talked about removing the formatting for now from devel in order to eliminate these conflicts until the release is done, but it's not simple:
- A team member implied a revert may not be adequate to prevent merge conflicts (based on how git works if I understand right) and that a complete removal from the history is needed
- A team member also said that adding K&R to the release-2.0 would not reduce merge conflicts because it would be recognized as a different change in the history.
- We had some more branches in which features are being tried out. Changes from devel have been merged into these branches. Some people also may have forks from github. The concern has been raised that history editing may cause issues for the other branches / forks.
I don't really want us to rush through the release in order to have less merge conflicts while keeping formatting, but I don't want us to cause even more serious problems by using a bad strategy for history editing in git. How might we resolve this?
The codebase is publicly viewable at https://github.com/Secretchronicles/SMC
Our discussion on this in github is at https://github.com/Secretchronicles/SMC/pull/159#issuecomment-54396354