Spread the Word
Automatically generate a release-note document based on git commit messages
Features
- Multiple projects are supported, which means git messages from multiple repositories can be merged to produce a unified release document
- Multiple output formats are supported, e.g. LaTeX
- Integrates with Wrike and GitLab to fetch developement task titles
- Integrates with Google Translate to automatically translate messages to English
- Caches Google Translate results on your local disk (
~/.spreadtheword
) so that Google API could incur less fee and it saves your money
Commit Message Conventions
-
{#1}
or#1
means issue #1 of Gitlab. Eg.{#63} add backend code for fields
orfix #23
; -
{prj#1}
orprj#1
means issue #1 of Gitlab projectprj
. Eg.{UI#1} add code for forms
orfix UI#23
; -
{W1}
means Wrike taskXXX
as in Wrike's permalinkhttps://www.wrike.com/open.htm?id=XXX
. Eg.{W4123780} fix config files
.
Install
gem install spreadtheword
Usage
spreadtheword [PROJECT 1] [PROJECT 2]...[PROJECT N] [OPTION 1] [OPTION 2]...[OPTION N]
--author=STRING Specifies the author of the output document. Default: user.name of git config
--console If present, start the console after spreadtheword initializes.
--google-translate-key=STRING
Specifies a Google Translate API access key and translate commit messages that contain non-ASCII characters to English.
-h, --help Prints this help and exit
--gitlab-endpoint=URL Specifies GitLab API endpoint URL.
--gitlab-token=STRING Specifies the OAuth access token of your GitLab.
--quiet If present, spreadtheword would not output anything to stderr.
--since=TAG/COMMIT-SHA1 Specifies the begining from which the git commits will be fetched. Default: the first commit
--title=STRING Specifies the title of the output document. Default: "Relase Notes"
--until=TAG/COMMIT-SHA1 Specifies the end to which the git commits will be fetched. Default: master
-v, --version Prints the version of spreadtheword and exit
--wrike-token=STRING Specifies the access token of your Wrike API app.
Notes
- If no projects were provided, the current directory would be used as the sole project directory;
- If multiple projects were provided, the git commit messages of those projects would be merged;
- If no options were specified, their default (see below) will be used.
Example
spreadtheword \
/projects/X \
/projects/Y \
--since=v1.5 \
--until=origin/releasing \
--title="Your Project v1.6 Release Notes" \
--author="Your Company, Inc." \
--google-translate-key="XXX" \
--gitlab-endpoint="https://example.net/api/v4" \
--gitlab-token="XXX" \
--wrike-token="XXX" \
> v1.6.tex
Hint: you might need to set environment variable LANG=en_US.UTF-8
to support wide characters of git log messages.
License
MIT
See Also
- gitlab: Ruby client and CLI for GitLab API.
- wrike3: Ruby client for the Wrike API V3.
- google-cloud-translate: the official library for Google Cloud Translation API.