1

The question Evil merges in git? has a couple of answers describing what an evil merge is, but at most one of them (Jakub Narębski) was addressing what problems can be caused by them, and why they should be avoided.

Ideally in terms that are easy for a beginner to understand by describing specific practical problems (eg something like "git log -p is less informative"), what disadvantages are there in creating an evil merge?

Community
  • 1
  • 1
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
  • I suppose I'm also confused about the example provided in the answer in your linked question. I'm not entirely sure how that piece of code could have *ever* materialized, considering that there's nowhere in the history that it seems to have come from. – Makoto Nov 30 '15 at 06:44

1 Answers1

4

I can see several problems:

  • If using feature branches, evil merges are a clear breach of the process. New code appears out of the blue without it being first committed to a feature branch (and hence possibly bypassing code review).
  • People simply do not expect a merge to introduce unrelated code.
  • When doing a diff over the evil merge, it can be hard to separate the changes pertaining to conflict resolution from those that introduce the unrelated code.
  • Cherry-picking becomes virtually impossible.
Michael Wild
  • 24,977
  • 3
  • 43
  • 43