用于指示存储库的Git挂钩已弃用 [英] Git hook to indicate repository is deprecated

查看:171
本文介绍了用于指示存储库的Git挂钩已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个存储库(托管在一个GitLab实例上),这是少数几个项目仍然引用的,但不赞成使用另一个解决方案。



有没有如何将资源库标记为已弃用?



理想情况下,每个从该资源库获取(作为 git子模块更新)会导致在获取期间打印巨大的消息。我期待添加一个简单的Git钩子来打印这个弃用的消息。但是,似乎不是在每次抓取时都会运行此操作。



另外,我在GitLab中看不到任何东西可以启用它。

解决方案

Gitlab具有名为广播消息自6.3开始 。在屏幕截图上,它们显示的消息颜色与标题和许多用户可能根本不会注意到它。



但是,可以为这些消息选择颜色自6.5开始。例如,我工作的管理员曾经发过蓝色消息,很难不注意到这个消息。



所以你可以


  • 制作明亮且可见的广播消息,告诉Gitlab的这个实例已被弃用,并且每个人都应该使用别的东西,因为在第X天,写入权限将被关闭。

  • 在第X天,每个人都是只读的。

  • 保留Gitlab的这个实例,这样旧的链接不会被破坏等等。


We have a repository (hosted on a GitLab instance) which a handful of projects still reference, but has been deprecated in favor of another solution.

Is there any way to mark a repository as "deprecated"?

Ideally, every fetch from this repository (as part of a git submodule update) would cause a giant message to be printed during the fetch. I was expecting to add a simple Git hook that would print this deprecated message. However, there doesn't seem to be a "run this on every fetch" hook.

Also, I see nothing in GitLab that would enable this.

解决方案

Gitlab has feature called "Broadcast messages" since 6.3. On the screenshot they shows message with the same color as header and many users could simply not notice it.

However, it is possible to choose color for these messages since 6.5. For example, administrators at my work once made blue message and it was very hard not to notice the message.

So you may

  • Make bright and visible broadcast message telling that this instance of Gitlab is deprecated and that everyone should use something else because at day X write access will be closed.
  • At day X make everyone read-only.
  • Leave this instance of Gitlab so old links won't be broke and so on.

这篇关于用于指示存储库的Git挂钩已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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