Skip to content

Feature request add GitLab built-in changelog templates #1560

Closed

Description

@JDanRibeiro

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

Feature description

GitLab integration has been supported since v2.3.0, but unlike GitHub there are no official built-in example templates under examples/. Users who want GitLab-oriented release notes need to write their own cliff.toml from scratch or adapt the GitHub templates manually.

This makes it harder to get started with:

git cliff --init <template>
git cliff --config <template>

### Desired solution

Add two built-in GitLab templates under `examples/`, embedded into the binary the same way as `github.toml` and `github-keepachangelog.toml`:

- **`gitlab.toml`** — release notes format for GitLab Releases: commits grouped by type, merge request links (`/-/merge_requests/`), first-time contributors, and tag links. Supports GitLab.com and self-hosted instances via `CI_PROJECT_URL` / `remote.gitlab.api_url`.
- **`gitlab-detailed.toml`** — detailed Keep a Changelog-style format with GitLab commit links (`/-/commit/`) and merge request links.

Update the documentation accordingly:

- `website/docs/usage/initializing.md` — list both templates for `--init` and `--config`
- `website/docs/integration/gitlab.md` — add a "GitLab Changelog" usage section (mirroring the GitHub integration doc)
- `website/docs/templating/examples.md` — add rendered previews for both templates

After merge and release, users should be able to run:

```bash
git cliff --init gitlab
git cliff --config gitlab
git cliff --config gitlab-detailed

### Alternatives considered

1. **Document a sample config only in the GitLab integration guide** — would work, but would not enable built-in `--init gitlab` / `--config gitlab`, and would be inconsistent with how GitHub templates are shipped in `examples/`.

2. **Provide a single GitLab template** — possible, but the GitHub side already offers both a release-notes style (`github.toml`) and a more detailed format (`github-keepachangelog.toml`); mirroring that split keeps the UX consistent.

3. **Rely on community configs or `--config-url`** — already possible, but templates are harder to discover and are not embedded in official releases.

4. **Adapt the existing GitHub templates manually** — feasible for advanced users, but GitLab URLs (`/-/merge_requests/`, `/-/commit/`, `/-/tags/`) and `gitlab.contributors` context differ enough that dedicated templates reduce setup friction.

### Additional context

_No response_

Metadata

Metadata

Assignees

Labels

feature/request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions