NAME

gitchangelog.sh - portable script generating a GNU-like changelog from a Git log

SYNOPSIS

gitchangelog.sh [options] [--] [ {-|outfile} [git_log_args] ]

gitchangelog.sh [options] [--] {-|outfile} -

OPTIONS

--tags

Prepend changelog entries by tag names in brackets.

--tag-pattern sed_BRE

Tags to consider for marking entries. The pattern should not match across spaces; the default is "[^ ]\{1,\}".

--merge

Prepend changelog entries by merge marks.

--title-only

Only keep the title of a commit. This implies --title-star, that can be disabled by a supplemental --git-body.

--title-star

Prepend the title by a star as is done with the other parapgraphs.

--git-body

Do not reformat the commit message, only reindent it.

--no-blankline

Do not separate the title from the rest by a blank line.

--version
--help, --helpm

DESCRIPTION

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.

PORTABILITY

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.

EXAMPLES

 $ ./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 -

AUTHOR

gitchangelog.sh was written by G.raud Meyer.

SEE ALSO

git-log(1)