Stamp 2 is one assembler-produced edit; changelog-armed's rule is stated mode-first (fragment, then legacy, #112 D7/D8/D9); changelog-assembled gets its operator section (#116); monotonic records D10; the two rewritten error strings and the retired re-arm recovery follow (#117).
25 lines
774 B
Bash
Executable file
25 lines
774 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
# shellcheck source=lib/changelog.sh
|
|
source "$ROOT/lib/changelog.sh"
|
|
|
|
ver="${1:-}"
|
|
changelog="${2:-CHANGELOG.md}"
|
|
if [ -z "$ver" ]; then
|
|
echo "usage: changelog-section <version> [<changelog>]" >&2
|
|
exit 2
|
|
fi
|
|
[ -f "$changelog" ] || {
|
|
echo "changelog-section: no such file: $changelog" >&2
|
|
exit 1
|
|
}
|
|
|
|
if ! diagnosis="$(changelog_section_problem "$changelog" "$ver")"; then
|
|
echo "changelog-section: $changelog has no section for '$ver' — the release PR assembles the section (changelog-assemble) with version + date BEFORE the tag" >&2
|
|
printf 'changelog-section: %s\n' "$diagnosis" >&2
|
|
exit 1
|
|
fi
|
|
notes="$(changelog_section "$changelog" "$ver")"
|
|
printf '%s\n' "$notes"
|