Skip to content

feat(examples): add GitLab built-in changelog templates - #1561

Merged
orhun merged 3 commits into
orhun:mainfrom
JDanRibeiro:feat/gitlab-example-templates
Jul 11, 2026
Merged

orhun merged 3 commits into
orhun:mainfrom
JDanRibeiro:feat/gitlab-example-templates

Conversation

@JDanRibeiro

@JDanRibeiro JDanRibeiro commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds two built-in GitLab changelog templates under examples/:

  • gitlab.toml — release notes format tailored for GitLab Releases (merge request links, contributors, tag links)
  • gitlab-keepachangelog.toml — detailed Keep a Changelog-style format with GitLab commit and merge request links

Also updates the documentation:

  • website/docs/usage/initializing.md — lists the new templates for --init and --config
  • website/docs/integration/gitlab.md — adds a "GitLab Changelog" section with usage examples
  • website/docs/templating/examples.md — adds rendered previews for both GitLab templates

Motivation and Context

GitLab integration has been supported since v2.3.0, but there were no official built-in templates equivalent to github.toml and github-keepachangelog.toml. This makes it harder for GitLab users to get started with --init / built-in --config names.

Closes #1560

How Has This Been Tested?

  • cargo build (templates are embedded via BuiltinConfig)
  • git cliff --init gitlab generates cliff.toml from the new template
  • git cliff --config gitlab --dry-run loads the built-in template
  • git cliff --config gitlab-keepachangelog --dry-run loads the detailed template
  • cargo test passes

Environment: git-cliff built from source with the gitlab feature enabled.

Screenshots / Logs (if applicable)

N/A

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (if applicable).
  • I have formatted the code with rustfmt.
    • cargo +nightly fmt --all — N/A (no Rust changes)
  • I checked the lints with clippy.
    • cargo clippy --tests --verbose -- -D warnings — N/A (no Rust changes)
  • I have added tests to cover my changes. — N/A (follows existing example template pattern)
  • All new and existing tests passed.
    • cargo test

@JDanRibeiro
JDanRibeiro requested a review from orhun as a code owner June 17, 2026 01:07

@orhun orhun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the PR, looks great! just have some suggestion for improving it

Comment thread examples/gitlab.toml Resolved
Comment thread examples/gitlab-keepachangelog.toml Resolved
Comment thread website/docs/integration/gitlab.md Resolved
Comment thread website/docs/usage/initializing.md Outdated
Comment on lines +38 to +39
- [`gitlab.toml`](https://github.com/orhun/git-cliff/tree/main/examples/gitlab.toml): release notes format tailored for GitLab Releases.
- [`gitlab-detailed.toml`](https://github.com/orhun/git-cliff/tree/main/examples/gitlab-detailed.toml): detailed changelog with GitLab commit and merge request links.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we remove the detailed template and just add keepachangelog one, just to be aligned with the GitHub template as well?

i.e. let's have gitlab and gitlab-keepachangelog :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The applied standard really makes a lot of sense.

Comment thread examples/gitlab-detailed.toml Outdated
{% macro print_commit(commit) -%}
- {% if commit.breaking %}**BREAKING:** {% endif %}{{ commit.message | split(pat="\n") | first | upper_first | trim }} \
([{{ commit.id | truncate(length=7, end="") }}]({{ self::project_url() }}/-/commit/{{ commit.id }}))\
{%- if commit.remote.pr_number %} in [!{{ commit.remote.pr_number }}]({{ self::project_url() }}/-/merge_requests/{{ commit.remote.pr_number }}){%- endif -%}\

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior was replicated, as shown in lines 44 and 67.
#1561 (comment)

- Fix missing newline before footer in gitlab.toml (unreleased output)
- Rename gitlab-detailed.toml to gitlab-keepachangelog.toml
- Use ! prefix for MR references and strip (orhun#123) from commit messages
- Update docs (initializing, integration, templating examples)
@JDanRibeiro
JDanRibeiro force-pushed the feat/gitlab-example-templates branch from 7249193 to 9888ee5 Compare June 25, 2026 04:51

@orhun orhun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Comment thread website/docs/usage/initializing.md Resolved
@orhun
orhun merged commit c92bd16 into orhun:main Jul 11, 2026
104 of 107 checks passed
@welcome

welcome Bot commented Jul 11, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! ⛰️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request add GitLab built-in changelog templates

2 participants