Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
177 views
in Technique[技术] by (71.8m points)

Evil merges in git?

"man gitglossary" contains this definition of an evil merge:

An evil merge is a merge that introduces changes that do not appear in any parent.

I am not sure I understand the point the authors are trying to get at. Why is it evil ?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Because it's putting things in the code that no one ever asked to be there. As if you had this code:

$foo = bar;
$baz = qxx;

and this change:

$foo = bar;
$foo++;
$baz = qxx;

got merged with this change:

$foo = bar;
$foo--;
$baz = qxx;

in a fashion that somehow produced:

$foo = bar;
$foo++;
$foo--;
--$baz;
$baz = qxx;

Clearly, this is evil.

I would guess that it's of enough concern to be in man gitglossary because the more involved your merging algorithms are, the more likely it is that they will produce such a thing.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...