GitLab:有没有办法给分支分配状态/评论? [英] GitLab: is there a way to assign a status/comment to a branch?

查看:1071
本文介绍了GitLab:有没有办法给分支分配状态/评论?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



目前,我正在使用Gitolite来管理用户Git服务器和MediaWiki具有什么叫分支表;换句话说,一个用户报告的表格:


  • 分支名称(例如xboard-feat-i2c2)

  • 分支维护者

  • 短分支描述(例如从rev 2.0.0开始,在自定义主机板X上实现i2c2驱动程序的功能分支)
  • 分支状态(WIP,测试,准备合并,中止)
  • 分支更长的信息(例如要构建这个分支,您必须更改并做到这一点(关于默认指令),我们目前在这方面有问题..等等)。在本节中,我通常还会写入参考用于测试此特定软件的测试平台/测试套件。


这里的主要问题是上面的表是手动创建的,有时用户忘记添加分支或重命名它们。



我想知道GitLab中是否有一个地方(或类似的工具)来插入这条信息。



我目前计划强制用户在存储库的根目录下创建一个README(或一个BRANCHREADME,以避免冲突)正如这里所解释的所有必需信息所解释的,我想知道是否有办法创建一个GitLab项目中的新页面显示各分支机构的所有README信息。

解决方案

我的解决方案解决了我自己的问题,每天与GitLab一起管理许多项目如下:




  • 创建一个问题(错误,新功能ecc)。描述问题/想法,而不是你如何解决问题。
  • 开始工作时创建一个新的MR(这可以通过问题本身的按钮来完成)。这将生成一个工作分支和MR(以WIP形式)

  • 解释您在完成工作后对MR

  • 所做的工作,从标题中删除WIP:

  • 合并MR并删除分支

  • 或者:关闭MR并删除分支没有用。



请注意,即使您关闭了MR并删除了分支,提交也会留在那里(即使没有直接通过git访问),所以你不会丢失任何工作。



当重新工作分支时,您也可以使用相同的工作流程:不想错过原来的实现(因为我可以在返工期间添加错误/问题),所以:
- 创建一个新的分支,后缀为修订版(例如 -v1 -v2 等等)
- 为这个分支创建一个新的MR,写下你的返工/评论
- 评论原始的MR或新的MR(它不真的很重要),并提及另一位MR (因此它们是链接的)
- 关闭原始MR并删除它的分支

这允许我每个项目的开放分支数量都很少(通常是合并或关闭),但具有关于已完成工作的文档,并且永远不会松动一次提交


I'm planning to use GitLab to manage Git repositories (mainly Linux kernels from various hardware vendors).

Currently, I'm using Gitolite to manage users on Git server and MediaWiki to have what a call a "branch table"; in other words, a table where the single users report:

  • branch name (e.g. xboard-feat-i2c2)
  • branch maintainer
  • short branch description (e.g. "started from rev 2.0.0, feature branch to implement i2c2 driver on custom hostboard X")
  • branch status (WIP, testing, ready to merge, aborted)
  • branch longer informations (e.g. "to build this branch you have to change this and do that (in respect to the default instruction). We currently have a problem on this.." and so on). On this section I also usually write reference to the test bed/test suite used to test this specific software.

The main problem here is that the above table is created manually, and sometimes, users forget to add branches or rename them.

I'm wondering whether there's a place in GitLab (or a similar tool) to insert this piece of information.

I'm currently planning to force the user create a README (or a BRANCHREADME, to avoid conflicts) on the root of the repository as explained here with all the required information and I'm wondering whether there's a way to create a new page in GitLab project to show all the README informations for the various branches.

解决方案

My solution to my own problems, after working daily for a couple of year with GitLab to manage many project is as follows:

  • create an issue for everything (bug, new feature ecc). Describe the problem/idea and not how you're solving it
  • when start working create a new MR (this can be done with the button into the issue itself). This generate both a working branch and the MR (as WIP)
  • explain what you're doing into the MR
  • once the work is done, remove the WIP from the title and, either:
  • merge the MR and delete the branch
  • or: close the MR and delete the branch if it's not useful.

Please note that, even if you close the MR and delete the branch, the commit will stay there (even if not "directly" accessible via git), so you're not loosing anything of your work.

You can also use the same workflow when "reworking" a branch: I don't want to miss the original implementation (because I can add bugs/issue during the rework) so: - create a new branch, with a suffix of revision (e.g. -v1, -v2 and so on) - create a new MR for this branch, writing down what your rework/review - comment the original MR or the new one (it doesn't really matters) with a reference to the other MR (so they are "linked") - close the original MR and delete its branch

This allows me to both have a low number of open branch per project (usually are merged or closed) but have documentation about the work done and never loose a single commit

这篇关于GitLab:有没有办法给分支分配状态/评论?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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