#!/bin/bash
# dev/package/changelog - ChangeLog generation support
set -e
lib_load 'sys/tool/git'
######
# Library Packages
dev_package_changelog_client_packages=( git2cl )
######
# Library Configuration
dev_package_changelog_config_init() {
lib_setting_vars --null package_changelog_start package_changelog_final
}
######
# git2cl Support
git2cl_run() {
local tmp
tmp=$(cmd_tempfile)
git_log --pretty --numstat --summary "$@" >"$tmp"
run git2cl <"$tmp"
}
######
# ChangeLog Generation
package_changelog_all() { git2cl_run "$@"; }
package_changelog_release() {
local tag=${1:-HEAD}
shift
[ "$tag" = "HEAD" ] || tag="v$tag"
local last
last=$(git_tag_prev "$tag" || true)
if [ "$last" ]; then
git2cl_run "$last..$tag" "$@"
else
warn "no changes were made in this release"
fi
}
# override autodetected syntax
# vim: syntax=sh
Generated on Wed Jun 28 07:39:51 PDT 2017 by mcsh d14 v0.20.0.