markdowngitlabgitlab-8

Create a link to compare tags in Gitlab markdown


We keep a changelog.md in the root of our gitlab projects and would like to include a link in each version tag to compare it to the previous tag.

The link needs to be e.g https://gitlab.company.com/group/project/compare/v15.4.0...v15.3.0

All relative links in markdown that I've tried end up relative to the current branch (including master) e.g. [v15.4.0](compare/v15.3.0...v15.4.0), [v15.4.0](../compare/v15.3.0...v15.4.0) and [v15.4.0](../../compare/v15.3.0...v15.4.0) all end up with the link https://gitlab.company.com/group/project/branch/compare/v15.3.0...v15.4.0

Is there a way to create a link relative to the project root rather than the current branch?


Solution

  • At least as of v12.6.4-ee the [v15.4.0](../compare/v15.3.0...v15.4.0) syntax generates the correct comparison link.

    I have been unable to find an issue etc where this behaviour was changed so unknown exactly which version it was in.