2016-05-29 47 views
1

例如,看一下this commit什么原因导致GitHub将提交显示为由一位用户*提交给另一位用户

enter image description here

注意如何两个用户都在这里显示,无论@unional和@blakeembrey。

这是什么原因造成的?


编辑一些进一步的研究:

$ git clone [email protected]:typings/typings.git 
$ cd typings 
$ git show abea10b5787e1a18634d5f37bb2fa56550c32fd1 
commit abea10b5787e1a18634d5f37bb2fa56550c32fd1 
Author: Homa Wong <[email protected]> 
Date: Thu May 26 09:47:58 2016 -0700 

    Update `bundle` help (#557) 

diff --git a/src/bin-bundle.ts b/src/bin-bundle.ts 
index 8e6dd26..2af3599 100644 
--- a/src/bin-bundle.ts 
+++ b/src/bin-bundle.ts 
@@ -5,11 +5,10 @@ import { bundle } from 'typings-core' 

export function help() { 
    return ` 
-typings bundle --out <directory> 
+typings bundle --out <filepath> 

Options: 
- [--out|-o] <directory> The bundled output directory 
- [--name] <name>  Bundle module name 
+ [--out|-o] <filepath> The bundled output file path 
    [--global|-G]   Bundle as an global definition 
` 
} 

有趣的是有一个在承诺中提到只有一个用户(unional)。这是否存储在GitHub中的一些额外的元数据?


EDIT 2实际上似乎git show没有给予充分的修补程序元数据。使用gitk我看到这个:

Author: Homa Wong <[email protected]> 2016-05-26 17:47:58 
Committer: Blake Embrey <[email protected]> 2016-05-26 17:47:58 
Parent: b79fd3f0f9af245a790717dcb5493fb49db2788d (Update README.md to add example of dt install (#547)) 
Branches: master, remotes/origin/master 
Follows: v1.0.4 
Precedes: 

    Update `bundle` help (#557) 

这里我们可以看到不同的作者和参与者。看起来这是一个重新发布而不是合并的公关。

+0

笔者VS提交者 –

+0

的一个@ IsmailBadawi,我不相信就是这样。看我的编辑。 –

回答

1

这是一个 合并 squash commit。当一个人通过合并合并拉请求/支全部提交到一个大的承诺,那些谁:

  • 创建拉入请求
  • 致力于将合并
  • 分支合并拉请求

将在创建的提交中显示为提交者。显然,创建拉取请求的人可以在提交中获得他/她的身份,并且将提交并压扁他们的人存储为元数据。

在这种情况下:

  • unional是谁创造了拉请求,并取得了一个唯一的提交
  • blakeembrey是谁合并拉请求
+0

如果它是合并提交,为什么它只有一个父代? –

+0

@DrewNoakes等等,[这不是传统的合并!](https://github.com/blog/2141-squash-your-commits) – dorukayhan

相关问题