如何让推送者的信息在接收后挂钩? [英] How to get pusher's Information in post-receive hooks?

查看:69
本文介绍了如何让推送者的信息在接收后挂钩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作者,提交者和推送者可以是Git中的不同人员,但git没有将推送者的信息存储在日志中。

所以,我如何得到它?

解决方案

您不需要。

上游回购不会对谁提供承诺做任何假设:它可以通过电子邮件,复制diff补丁USB密钥和其他 各种传输协议
$ b

其中一些协议(ssh,https)可能在其日志中包含您要查找的信息,但是:




  • 这与Git无关

  • 假设它们的日志级别设置得当。

  • 即使是 Gitolite ,在 gitolite-admin注册的公共ssh密钥的名称 repo可以是任何你想要的,并且与真实姓名无关。



正如Linus提到的为什么一些开源项目不接受pull请求,但只发送补丁文件?):


由于github身份是随机的,我期望拉请求是 签名标签 ,以便我可以验证相关人员的身份。

因此,如果您想要推荐某些提交,以保证所有回购的完整性,您可以制作并签名标记在被推入的 HEAD 上,以便上游回购认为你不是推动者,而是验证推动的东西


Author, Committer and Pusher can be different person in Git, but git didn't store the pusher's information in logs.

So, How do i get it?

解决方案

You don't.
The upstream repo doesn't make any assumption about who is providing commit: it can be through email, a diff patch copied on a USB key, and other various transfer protocol.

Some of those protocols (ssh, https) might have in their logs the information you seek, but:

  • this has nothing to do with Git
  • this suppose their log level is appropriately set.
  • even for Gitolite, the name of the public ssh key registered in the gitolite-admin repo can be anything you want, and not related to a real name.

As Linus mentions (in "Why do some open source projects do not accept pull requests, but emailing patch files only?"):

since github identities are random, I expect the pull request to be a signed tag, so that I can verify the identity of the person in question.

So if you want, as someone pushing some commits, to vouch for the integrity of the all repo, you can make and sign a tag on the HEAD of what is being pushed, in order for the upstream repo to consider you as, not exactly the "pusher", but the one validating what has been pushed

这篇关于如何让推送者的信息在接收后挂钩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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