1#!/bin/sh 2# 3# Dumb script for making a ChangeLog. 4# 5# Invoke like: 6# 7# scripts/git2changelog.sh --after="2010-02-01" --until="2010-02-31" 8# 9 10set -e 11 12tmp_changelog=$(mktemp /tmp/changelog.XXXXXX) 13 14trap "[ -f '$tmp_changelog' ] && rm -f '$tmp_changelog'; [ -f '$changelog~' ] && mv '$changelog~' '$changelog'" 0 2 15 15 16changelog="${0%/*}/../ChangeLog" 17 18git log --format="%nCommit: %H%nDate: %aD%n%n%s%n%b%nChanged Files:" \ 19 --name-only "$@" > "$tmp_changelog" 20 21cat "$changelog" >> "$tmp_changelog" 22 23mv "$changelog" "$changelog~" 24 25# This may take a while... 26mv "$tmp_changelog" "$changelog" 27 28rm -f "$changelog~" 29