gitchangelog.sh - portable script generating a GNU-like changelog from a Git log
gitchangelog.sh [options] [--] [ {-|outfile} [git_log_args] ]
gitchangelog.sh [options] [--] {-|outfile} -
Prepend changelog entries by tag names in brackets.
Tags to consider for marking entries. The pattern should not match across spaces; the default is "[^ ]\{1,\}".
Prepend changelog entries by merge marks.
Only keep the title of a commit. This implies --title-star, that can be disabled by a supplemental --git-body.
Prepend the title by a star as is done with the other parapgraphs.
Do not reformat the commit message, only reindent it.
Do not separate the title from the rest by a blank line.
Each commit message is made into a changelog entry. Each paragraph of a Git commit message body is made into a star item of the changelog. The message title is kept on a separate line. Text lines are never broken nor joined.
By default git is run to get the log, with the required options. If a dash is given in place of additional git_log_args, then the log is read from the standard input; in that case pass the option --date=short and possibly also --decorate to git to get the appropriate log format.
The script is portable to POSIX sh and to other less comformant shells such as pdksh.
The sed code is portable to POSIX sed but requires only Simple Regular Expressions (SRE) instead of Basic Regular Expressions (BRE) which makes it prone to work under Solaris and old BSDs. git-log is required if the log is not read from stdin.
$ ./gitchangelog.sh --title-star --no-blankline GNUChangeLog
$ ./gitchangelog.sh --tags --tag-pattern 'release\/[^ ]*' -- - --date-order |
sed 's/^\[release/^L\[release/' > ChangeLog
$ git log --date=short --decorate --first-parent |
./gitchangelog.sh --merge ChangeLog -
gitchangelog.sh was written by G.raud Meyer.
git-log(1)