#!/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 Script Reference Index


Generated on Tue Apr 25 21:20:29 PDT 2017 by mcsh i7 v0.18.0.