Files
lazysecrets/cliff.toml
T
keb 9b0329e9da feat: the changelog in the status pane, built in (#12)
The status pane's rows (`0`, then `enter`) end with the changelog: every release up to the running one, newest first.

```
v0.2.0     2026-10-12
           added: Search with fzf's scoring and query syntax (#11) (65dc2d7)
           fixed: …
v0.1.0     2026-10-10
           Hello world 👋
```

- `CHANGELOG.md` is embedded at build time by a small root package (`changelog.go`, `package lazysecrets`, `//go:embed`), so it needs no network and matches the binary. `release.sh` updates the file before tagging, so a release's binary includes its own entry. `go install …@latest` gets it too, since the module includes the file.
- Entries show as text: links become `(#11) (65dc2d7)` (`update.PlainLinks`, shared with the `U` notes). `/` filters them like any Fields pane (`/fixed`, `/search`), and `y` copies one.
- `cliff.toml`: #11 was squash-merged with #10 (the status pane) in it, so a preprocessor rewrites its entry to name both. Otherwise the status pane would be missing from the changelog.

Test for the parsing: versions and dates, kinds, links as text, a release's own words, and the header and footer left out.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
Reviewed-on: #12
2026-10-11 13:12:51 +02:00

68 lines
2.8 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# git-cliff (https://git-cliff.org) builds CHANGELOG.md and the release
# notes from the commits on main. Pull requests are squash-merged, so each
# one is a single commit whose message is the PR title: a conventional one
# (feat: …, fix: …, perf: …) puts it in the changelog, anything else
# (chore, ci, docs, refactor, test, …) leaves it out.
#
# git cliff --unreleased # what the next release would say
[changelog]
header = """
# Changelog
Every release of lazysecrets, newest first.\n
"""
body = """
{% if version -%}
## {{ version }} – {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## Unreleased
{% endif -%}
{% if commits | length == 0 %}
Hello world 👋
{% endif -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim }}
{% for commit in commits %}
- {% if commit.breaking %}**Breaking:** {% endif %}{{ commit.message | split(pat="\n") | first | upper_first | trim }} \
([{{ commit.id | truncate(length=7, end="") }}](https://git.kebcloud.no/keb/lazysecrets/commit/{{ commit.id }}))\
{% endfor %}
{% endfor %}\n
"""
footer = "<!-- generated by git-cliff (cliff.toml) -->"
trim = true
# Runs on each part (header, every release) separately.
postprocessors = [
{ pattern = "\n{3,}", replace = "\n\n" },
# Squash commits end in the PR's number: link it.
{ pattern = "\\(#([0-9]+)\\)", replace = "([#${1}](https://git.kebcloud.no/keb/lazysecrets/pulls/${1}))" },
]
[git]
conventional_commits = true
filter_unconventional = false
split_commits = false
protect_breaking_commits = true
tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+$"
sort_commits = "oldest"
commit_preprocessors = [
# A merge commit (not a squash) says "Merge pull request 'feat: …' (#4)
# from branch into main": keep the title and number.
{ pattern = "^Merge pull request '(.+)' \\((#[0-9]+)\\) from .*", replace = "${1} (${2})" },
# #11 was squash-merged with #10 (the status pane) in it: name both.
{ pattern = "^feat: link each changelog entry to its PR and commit \\(#11\\)", replace = "feat: a status pane (0) with version, updates, accounts, files and links; changelog entries link to their PR and commit (#11)" },
# Titles may be written "[feat] x", "[feat]: x" or "feat:x" (see
# pr-title.yml); all become "feat: x".
{ pattern = "^\\[(feat|fix|perf|refactor|docs|test|ci|chore|build|style|revert)(\\([^)]*\\))?(!?)\\](!?):?\\s*", replace = "${1}${2}${3}${4}: " },
{ pattern = "^(feat|fix|perf|refactor|docs|test|ci|chore|build|style|revert)(\\([^)]*\\))?(!?):(\\S)", replace = "${1}${2}${3}: ${4}" },
]
commit_parsers = [
{ body = "\\[skip changelog\\]", skip = true },
{ message = "^[a-z]+(\\(.*\\))?!:", group = "<!-- 0 -->Added" },
{ message = "^feat", group = "<!-- 0 -->Added" },
{ message = "^perf", group = "<!-- 1 -->Changed" },
{ message = "^fix", group = "<!-- 2 -->Fixed" },
{ message = ".*", skip = true },
]