19

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.

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
  • 1
    Won't the "post-checkout" and/or "post-merge" hooks cover the situations you need? – Waylan Jun 22 '15 at 15:23
  • 1
    Deleting or renaming/relocating the repository would cause every fetch from that repository to fail in a rather obvious way... – twalberg Jun 22 '15 at 15:33
  • @Waylan Those are locally-installed, no? I want a hook on the remote server that complains. – Jonathon Reinhart Jun 22 '15 at 16:05
  • 1
    @twalberg Yes, I'd considered that, but I don't want things to fail to work (yet). I want to make a smooth transition to the new solutions. – Jonathon Reinhart Jun 22 '15 at 16:05
  • As I see it there is currently no way to realize this with the tools git provides you. Maybe you could add a bounch of `THIS REPOSITORY IS DEPRECATED` files? – Sascha Wolf Jun 30 '15 at 07:34
  • What about changing access rules to deprecated repositories in Gitlab? Explicitly allow access for projects that already reference a deprecated repository and deny access for everybody else. – nils Jul 02 '15 at 08:31
  • @nils "Project" == "Repository". Project access rules apply to users. This doesn't help unfortunately. – Jonathon Reinhart Jul 02 '15 at 17:08
  • Similar question (not gitlab related, just git): https://stackoverflow.com/questions/35659916/git-remote-show-a-custom-message-at-every-clone-fetch – Sybille Peters Aug 25 '21 at 09:33

1 Answers1

1

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.
Kirill
  • 3,364
  • 2
  • 21
  • 36