如何让 Git 提交历史记录显示在 Redmine 问题跟踪器上

发布于 2024-10-21 02:57:49 字数 1331 浏览 1 评论 0原文

我按照本文的说明,使用 Git 存储库在我的 DreamHost 帐户上设置了一个 Redmine 站点。

到目前为止,它运行良好,我可以使用 Redmine 管理我的项目,并使用 SSH 将我的代码提交到 Git 存储库,并且我可以使用 Redmine 用户界面浏览我的源代码并提交历史记录。

但我有一个问题:它不像 Redmine 官方网站那样将 Git 提交历史记录与问题跟踪器挂钩。

例如,http://www.redmine.org/issues/7000。

但就我而言,我创建了一个由Redmine编号为#5的票证,并且创建了如下提交日志:

commit 580fdb33877d7b4167863f5138973b7a83b352aa
Author: Brian Hsu <[email protected]>
Date:   Fri Mar 11 11:43:43 2011 +0800

    Add README file. (#5)

commit 9cf0d98a319ffca501dc541c76a6cff9a32d6146
Author: Brian Hsu <[email protected]>
Date:   Fri Mar 11 11:40:00 2011 +0800

    Inital commit.

我可以在源代码浏览器的版本控制选项卡中看到这些提交,然后单击“#5”进入到问题#5。但在该票证中,它没有显示该票证中 580fdb33877d7b4167863f5138973b7a83b352aa 的提交日志。

那么我如何挂钩 Git 和 Redmine 问题跟踪器呢?

顺便说一句,我遵循了“成功的 Git 分支”提到的 master/develop 两个分支工作流程model”,所以我希望Redmine将提交挂接到开发分支而不是master分支中。

谢谢。

I followed the instruction of this article and setup an Redmine site on my DreamHost account with Git repository.

It works fine so far, I could manage my project using Redmine, and commit my code to the Git repository using SSH, and I could browse my source code and commit history using Redmine user interface.

But there is my problem: It does not hook Git commit history with issue tracker like the official Redmine site.

For example, there is a commit log listed on http://www.redmine.org/issues/7000.

But in my case, I created a ticket which is numbered by Redmine as #5, and I created a commit log like the following:

commit 580fdb33877d7b4167863f5138973b7a83b352aa
Author: Brian Hsu <[email protected]>
Date:   Fri Mar 11 11:43:43 2011 +0800

    Add README file. (#5)

commit 9cf0d98a319ffca501dc541c76a6cff9a32d6146
Author: Brian Hsu <[email protected]>
Date:   Fri Mar 11 11:40:00 2011 +0800

    Inital commit.

I could see these commit in the source code browser in version control tab and click "#5" to go to the issue #5. But in that ticket, it does not show the commit log of 580fdb33877d7b4167863f5138973b7a83b352aa in that ticket.

So how could I hook Git and Redmine issue tracker?

BTW, I followed the master/develop two branch workflow mentioned by "A successful Git branching model", so I would like Redmine to hook the commit in develop branch instead of master.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

A君 2024-10-28 02:57:49

对不起,是我的错。

有一些关键字将提交历史记录与页面上列出的问题跟踪票证关联起来 http://yourredminesite/settings/edit ?tab=repositories

用“refs #5”更改我的提交日志,它就可以工作了。

Sorry, my fault.

There are keywords to associate the commit history with issue tracker tickets listed on the page http://yourredminesite/settings/edit?tab=repositories

Change my commit log with "refs #5" and it works.

笑叹一世浮沉 2024-10-28 02:57:49

我是 Redmine 新手,但据我所知,您应该能够仅使用“#”,例如 #5 作为参考。然后,提及参考 ID 的提交应该会出现在问题中。

请参阅 Redmine - Defect #7593,它似乎涵盖了此问题,尽管票证已关闭。

总之,他们建议在关键字列表中使用“*”(以 Redmine 管理员用户身份登录 - 然后导航到管理/设置/存储库/引用关键字)。 OP 评论说他必须删除 git 存储库并将其重新添加到 Redmine 项目中,以触发重新解析提交评论,以便使用正确的链接更新问题。

I'm new to Redmine but AFAIK you should be able to just use '#', e.g. #5 as the reference. Then the commits mentioning the reference ID should show up in the issue.

See Redmine - Defect #7593 that seems to cover this issue, although the ticket is closed.

In summary they recommend using '*' in your list of keywords (logon as Redmine Admin user - then navigate to Administration/Settings/Repositories/Referencing keywords). The OP the comments that he had to delete and re-add the git repository to the Redmine project to trigger reparsing of the commit comments so the issues were updated with the correct links.

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