邪恶融入git? [英] Evil merges in git?

查看:203
本文介绍了邪恶融入git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

man gitglossary 包含邪恶合并的定义:


邪恶的合并是一种合并,

我不确定我是否理解作者试图获得的观点在。为什么它是邪恶的?

解决方案

因为它将代码放在没有人问过的代码中。就好像你有这样的代码:

  $ foo = bar; 
$ baz = qxx;

以及此更改:

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

合并了此更改:

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

以某种方式产生:

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

显然,这是邪恶的。

我猜想,在 man gitglossary 中有足够的关注点,因为你的合并算法越多,它们就越有可能产生这样的结果。 p>

"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 ?

解决方案

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.

这篇关于邪恶融入git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆