diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/cliff.toml | 36 | ||||
-rw-r--r-- | scripts/gen_help_html.lua | 5 | ||||
-rwxr-xr-x | scripts/git-log-pretty-since.sh | 52 | ||||
-rwxr-xr-x | scripts/release.sh | 20 |
4 files changed, 33 insertions, 80 deletions
diff --git a/scripts/cliff.toml b/scripts/cliff.toml index ac060b7796..51725cacfc 100644 --- a/scripts/cliff.toml +++ b/scripts/cliff.toml @@ -4,27 +4,29 @@ # changelog header header = """ # Changelog\n -All notable changes to this project will be documented in this file.\n +For notable changes, see runtime/doc/news.txt (or `:help news` in Nvim).\n +Following is a list of fixes/features commits.\n """ # template for the changelog body # https://github.com/Keats/tera # https://keats.github.io/tera/docs/ body = """ {% if version %}\ - ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + # [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} {% else %}\ - ## [unreleased] + # [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ### {{ group | striptags | upper_first }} + {{ group | striptags | upper_first }} + -------------------------------------------------------------------------------- {% for commit in commits | sort(attribute="message")%}\ {% if not commit.scope %}\ - - {{ commit.message }} + - {{ commit.id | truncate(length=12, end="") }} {{ commit.message }} {% endif %}\ {% endfor %}\ {% for group, commits in commits | group_by(attribute="scope") %}\ {% for commit in commits | sort(attribute="message") %}\ - - **{{commit.scope}}**: {{ commit.message }} + - {{ commit.id | truncate(length=12, end="") }} {{commit.scope}}: {{ commit.message }} {% endfor %}\ {% endfor %} {% endfor %}\n @@ -45,18 +47,18 @@ commit_preprocessors = [ ] # regex for parsing and grouping commits commit_parsers = [ - { message = "!:", group = "<!-- 0 -->Breaking"}, - { message = "^feat", group = "<!-- 1 -->Features"}, - { message = "^fix", group = "<!-- 2 -->Bug Fixes"}, - { message = "^perf", group = "<!-- 3 -->Performance"}, - { message = "^build", group = "<!-- 4 -->Build System"}, - { message = "^vim-patch", group = "<!-- 5 -->Vim patches"}, - { message = "^refactor", group = "<!-- 6 -->Refactor" }, + { message = "!:", group = "<!-- 0 -->BREAKING"}, + { message = "^feat", group = "<!-- 1 -->FEATURES"}, + { message = "^fix", group = "<!-- 2 -->FIXES"}, + { message = "^perf", group = "<!-- 3 -->PERFORMANCE"}, + { message = "^build", group = "<!-- 4 -->BUILD"}, + { message = "^vim-patch", group = "<!-- 5 -->VIM PATCHES"}, + { message = "^refactor", group = "<!-- 6 -->REFACTOR" }, { message = "^ci", group = "<!-- 8 -->CI" }, - { message = "^test", group = "<!-- 9 -->Testing" }, - { message = "^docs", group = "<!-- 99 -->Documentation" }, - { message = "^revert", group = "<!-- 999 -->Reverted Changes" }, - { message = ".*", group = "<!-- 9999 -->Other"}, + { message = "^test", group = "<!-- 9 -->TESTING" }, + { message = "^docs", group = "<!-- 99 -->DOCUMENTATION" }, + { message = "^revert", group = "<!-- 999 -->REVERTED CHANGES" }, + { message = ".*", group = "<!-- 9999 -->OTHER"}, ] # filter out the commits that are not matched by commit parsers filter_commits = true diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua index 7051c8dbc3..d65f3aace2 100644 --- a/scripts/gen_help_html.lua +++ b/scripts/gen_help_html.lua @@ -63,10 +63,15 @@ local new_layout = { ['channel.txt'] = true, ['deprecated.txt'] = true, ['develop.txt'] = true, + ['dev_style.txt'] = true, + ['dev_theme.txt'] = true, + ['dev_tools.txt'] = true, + ['dev_vimpatch.txt'] = true, ['lua.txt'] = true, ['luaref.txt'] = true, ['news.txt'] = true, ['news-0.9.txt'] = true, + ['news-0.10.txt'] = true, ['nvim.txt'] = true, ['pi_health.txt'] = true, ['provider.txt'] = true, diff --git a/scripts/git-log-pretty-since.sh b/scripts/git-log-pretty-since.sh deleted file mode 100755 index 95dcee23f5..0000000000 --- a/scripts/git-log-pretty-since.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -# Prints a nicely-formatted commit history. -# - Commits are grouped below their merge-commit. -# - Issue numbers are moved next to the commit-id. -# -# Parameters: -# $1 "since" commit -# $2 "inverse match" regex pattern - -set -e -set -u -set -o pipefail - -__SINCE=$1 -__INVMATCH=$2 - -is_merge_commit() { - git rev-parse "$1" >/dev/null 2>&1 \ - || { echo "ERROR: invalid commit: $1"; exit 1; } - git log "$1"^2 >/dev/null 2>&1 && return 0 || return 1 -} - -# Removes parens from issue/ticket/PR numbers. -# -# Example: -# in: 3340e08becbf foo (#9423) -# out: 3340e08becbf foo #9423 -_deparen() { - sed 's/(\(\#[0-9]\{3,\}\))/\1/g' -} - -# Cleans up issue/ticket/PR numbers in the commit descriptions. -# -# Example: -# in: 3340e08becbf foo (#9423) -# out: 3340e08becbf #9423 foo -_format_ticketnums() { - nvim -Es +'g/\v(#[0-9]{3,})/norm! ngEldE0ep' +'%p' | _deparen -} - -for commit in $(git log --format='%H' --first-parent "$__SINCE"..HEAD); do - if is_merge_commit "${commit}" ; then - if [ -z "$__INVMATCH" ] || ! git log --oneline "${commit}^1..${commit}^2" \ - | >/dev/null 2>&1 grep -E "$__INVMATCH" ; then - git log -1 --oneline "${commit}" - git log --format=' %h %s' "${commit}^1..${commit}^2" - fi - else - git log -1 --oneline "${commit}" - fi -done | _format_ticketnums diff --git a/scripts/release.sh b/scripts/release.sh index f798b81d6a..8e26ecb244 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -31,30 +31,28 @@ __DATE=$(date +'%Y-%m-%d') __LAST_TAG=$(git describe --abbrev=0) [ -z "$__LAST_TAG" ] && { echo 'ERROR: no tag found'; exit 1; } __VERSION_MAJOR=$(grep 'set(NVIM_VERSION_MAJOR' CMakeLists.txt\ - |$__sed 's/.*NVIM_VERSION_MAJOR ([[:digit:]]).*/\1/') + |$__sed 's/.*NVIM_VERSION_MAJOR ([[:digit:]]+).*/\1/') __VERSION_MINOR=$(grep 'set(NVIM_VERSION_MINOR' CMakeLists.txt\ - |$__sed 's/.*NVIM_VERSION_MINOR ([[:digit:]]).*/\1/') + |$__sed 's/.*NVIM_VERSION_MINOR ([[:digit:]]+).*/\1/') __VERSION_PATCH=$(grep 'set(NVIM_VERSION_PATCH' CMakeLists.txt\ - |$__sed 's/.*NVIM_VERSION_PATCH ([[:digit:]]).*/\1/') + |$__sed 's/.*NVIM_VERSION_PATCH ([[:digit:]]+).*/\1/') __VERSION="${__VERSION_MAJOR}.${__VERSION_MINOR}.${__VERSION_PATCH}" __API_LEVEL=$(grep 'set(NVIM_API_LEVEL ' CMakeLists.txt\ - |$__sed 's/.*NVIM_API_LEVEL ([[:digit:]]).*/\1/') + |$__sed 's/.*NVIM_API_LEVEL ([[:digit:]]+).*/\1/') { [ -z "$__VERSION_MAJOR" ] || [ -z "$__VERSION_MINOR" ] || [ -z "$__VERSION_PATCH" ]; } \ && { echo "ERROR: version parse failed: '${__VERSION}'"; exit 1; } __RELEASE_MSG="NVIM v${__VERSION} -FEATURES: - -FIXES: - -CHANGES: - " __BUMP_MSG="version bump" echo "Most recent tag: ${__LAST_TAG}" echo "Release version: ${__VERSION}" +_git_log_pretty() { + git cliff --config scripts/cliff.toml --unreleased || echo 'git cliff failed' +} + _do_release_commit() { $__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt if grep '(NVIM_API_PRERELEASE true)' CMakeLists.txt > /dev/null; then @@ -73,7 +71,7 @@ _do_release_commit() { echo "Building changelog since ${__LAST_TAG}..." git add CMakeLists.txt - (echo "${__RELEASE_MSG}"; ./scripts/git-log-pretty-since.sh "$__LAST_TAG" 'vim-patch:[^[:space:]]') | git commit --edit -F - + (echo "${__RELEASE_MSG}"; _git_log_pretty) | git commit --edit -F - fi git tag --sign -a v"${__VERSION}" -m "NVIM v${__VERSION}" |