clog
A conventional changelog for the rest of us
About
clog
creates a changelog automatically from your local git metadata. See the clog
s changelog.md for an example.
The way this works, is every time you make a commit, you ensure your commit subject line follows the conventional format. Then when you wish to update your changelog, you simply run clog
inside your local repository with any options you'd like to specify.
NOTE: clog
also supports empty components by making commit messages such as alias: message
or alias(): message
(i.e. without the component)
Usage
There are two ways to use clog
, via the command line or a library in your applicaitons.
Command Line
)
)
)
)
)
)
)
)
)
)
)
) )
)
Try it!
-
Clone the repo
git clone https://github.com/thoughtram/clog && cd clog
-
Build clog
cargo build --release
-
Delete the old changelog file
rm changelog.md
-
Run clog
./target/release/clog -r https://github.com/thoughtram/clog --setversion 0.1.0 --subtitle crazy-dog --from 6d8183f
As a Library
See the documentation for information on using clog
in your applications.
Try it!
- Clone the
clog
repo so that you have something to search through (Becauseclog
uses specially formatted commit messages)
$ git clone https://github.com/thoughtram/clog ~/clog
- Add
clog
as a dependency in yourCargo.toml
[]
= "*"
- Use the following in your
src/main.rs
extern crate clog;
use Clog;
- Compile and run `$ cargo build --release && ./target/release/bin_name
- View the output in your favorite markdown viewer!
$ vim changelog.md
Default Options
clog
can also be configured using a default configuration file so that you don't have to specify all the options each time you want to update your changelog. To do this add a .clog.toml
file to your repository.
[]
= "https://github.com/thoughtram/clog"
= "my awesome title"
# specify the style of commit links to generate, defaults to "github" if omitted
= "github"
# sets the changelog output file, defaults to "changelog.md" if omitted
= "MyChangelog.md"
# If you use tags, you can set the following if you wish to only pick
# up changes since your latest tag
= true
Now you can update your MyChangelog.md
with clog --patch
(assuming you want to update from the latest tag version, and increment your patch version by 1).
Note: Any options you specify at the command line will override options set in your .clog.toml
Custom Sections
By default, clog
will display two sections in your changelog, Features
and Bug Fixes
. You can add additional sections by using a .clog.toml
file. To add more sections, simply add a [sections]
table, along with the section name and aliases you'd like to use in your commit messages:
[]
= ["mysec", "ms"]
Now if you make a commit message such as mysec(Component): some message
or ms(Component): some message
there will be a new "MySection" section along side the "Features" and "Bug Fixes" areas.
NOTE: Sections with spaces are suppported, such as "My Special Section" = ["ms", "mysec"]
LICENSE
clog is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.