有没有办法从 git 命令行访问 Gitorious 中的合并请求列表?

发布于 2024-12-03 06:07:44 字数 402 浏览 1 评论 0原文

我们希望在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风尘浪孓 2024-12-10 06:07:44

事实证明这并不是非常困难:

git fetch origin +refs/merge-requests/*:refs/merge-requests/*

这会获取未完成的合并请求的列表,这主要是我想要的。我希望可以通过删除相应的引用来关闭合并请求,但这不起作用。

It turns out this isn't terribly difficult:

git fetch origin +refs/merge-requests/*:refs/merge-requests/*

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文