#!/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

View the Developer Guide Index

View the Reference Manual Index


Generated on Fri Jul 28 14:35:15 PDT 2017 by mcsh d14 v0.23.0.