有没有办法从 git 命令行访问 Gitorious 中的合并请求列表?
我们希望在 Gitorious 实例中实现一些合并请求的自动处理。我们想做的一切都很简单……如果我们有某种方法可以通过 git 枚举待处理的合并请求。我看到 Gitorious 实际上将这些转储到(托管)git 存储库中的 refs/merge-requests/nnn 中,但似乎没有任何方法让 git 将其传输到客户端。
我只查看了屏幕抓取合并请求列表,但由于我们广泛使用 OpenID 进行身份验证,因此最终变得相当复杂(加载 Gitorious 登录屏幕,提交,按照重定向到 OpenID 服务器,提交登录表单,响应可选验证,按照重定向回 Gitorious,等等...)。
我们要做的是创建存储库的工作副本,在其中创建与每个合并请求相对应的本地分支,然后在该分支中应用合并请求。我们为什么要这样做?因为我们在课程设置中滥用合并请求作为作业提交机制。
We would like to implement some automated processing of merge requests in a Gitorious instance. Everything we want to do is easy...if there were some way for us to enumerate the pending merge requests via git. I see that Gitorious actually dumps these into refs/merge-requests/nnn
in the (hosted) git repository, but there doesn't seem to be any way to get git to transfer this to a client.
I've looked at just screen-scraping the list of merge requests, but since we're making extensive use of OpenID for authentication it ends up being fairly complicated (load the Gitorious login screen, submit, follow the redirect to the OpenID server, submit the login form, respond to the optional verification, follow the redirect back to Gitorious, etc...).
What we're looking to do is create a working copy of the repository in which we will create a local branch corresponding to each merge request, and then apply the merge request in that branch. Why are we doing this? Because we're abusing merge requests as a homework submission mechanism in a course setting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明这并不是非常困难:
这会获取未完成的合并请求的列表,这主要是我想要的。我希望可以通过删除相应的引用来关闭合并请求,但这不起作用。
It turns out this isn't terribly difficult:
This gets the list of outstanding merge requests, which is mostly what I wanted. I was hoping one could close the merge request by deleting the corresponding reference, but that doesn't work.