Skip to content

Commit

Permalink
feat: commit template (#91)
Browse files Browse the repository at this point in the history
* fix(tests): expect the right git tag command

Co-authored-by: Gleb Popov <[email protected]>

Closes #71 #84 #79
  • Loading branch information
rafinskipg authored Apr 21, 2020
1 parent 567232d commit 06eebc4
Show file tree
Hide file tree
Showing 20 changed files with 791 additions and 547 deletions.
1 change: 1 addition & 0 deletions .changelogrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"intro": "Git changelog is a utility tool for generating changelogs. It is free and opensource. :)",
"debug": "true",
"template": "templates/template.md",
"commit_template": "templates/commit_template.md",
"sections": [
{
"title": "Bug Fixes",
Expand Down
18 changes: 0 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@ _Git changelog is a utility tool for generating changelogs. It is free and opens



## Refactor
- Use native promises
([6a36fac0]([email protected]:rafinskipg/git-changelog/commit/6a36fac0e4670240155bfdc0800cbc28fdfc545f))
- replaced deprecated createOutputStream method with createWriteStream
([f27a64c4]([email protected]:rafinskipg/git-changelog/commit/f27a64c4451e73d85dfe06c394e2368ce4d3c33a))




## Chore
- added node v12 to travis config
([b527965b]([email protected]:rafinskipg/git-changelog/commit/b527965ba0922f16342801c258790349f7195766))
- updated fs-extra version to latest
([99905e5c]([email protected]:rafinskipg/git-changelog/commit/99905e5c0d44fb33305d27fd94540304b145405e))





---
<sub><sup>*Generated with [git-changelog](https:/rafinskipg/git-changelog). If you have any problems or suggestions, create an issue.* :) **Thanks** </sub></sup>
533 changes: 190 additions & 343 deletions EXTENDEDCHANGELOG.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ module.exports = function(grunt) {
debug: true
}
},
customCommitTemplate: {
options: {
app_name : 'Custom Commit Template',
intro: 'This changelog is generated with a custom commit template',
file: 'output/customCommitTemplate.md',
commit_template: 'templates/commit_template_two.md',
logo : 'https:/rafinskipg/git-changelog/raw/master/images/git-changelog-logo.png',
version_name : 'custom commit template potatoe',
tag: 'v0.0.1',
debug: true
}
},
extended: {
options: {
app_name : 'Git changelog extended',
Expand Down
97 changes: 60 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,49 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Breaking changes](#breaking-changes)
- [`.changelogrc` specification](#changelogrc-specification)
- [The "git_changelog" task](#the-git_changelog-task)
- [Grunt Task](#grunt-task)
- [Getting Started](#getting-started)
- [Options | Defaults](#options-%7C-defaults)
- [Command Line](#command-line)
- [Git Commit Guidelines - Source : "Angular JS"](#git-commit-guidelines---source--angular-js)
- [Commit Message Format](#commit-message-format)
- [Example types](#example-types)
- [Scope](#scope)
- [Subject](#subject)
- [Body](#body)
- [Footer](#footer)
- [Tagging your project](#tagging-your-project)
- [ROADMAP](#roadmap)
- [v0.3.0](#v030)
- [Release History](#release-history)
- [Contributors](#contributors)
- [V1.0.0](#v100)
- [v1.1.0](#v110)
- [`.changelogrc` specification](#changelogrc-specification)
- [Options | Defaults](#options--defaults)
- [The "git_changelog" task](#the-%22gitchangelog%22-task)
- [Grunt Task](#grunt-task)
- [Getting Started](#getting-started)
- [Command Line](#command-line)
- [Git Commit Guidelines - Source : "Angular JS"](#git-commit-guidelines---source--%22angular-js%22)
- [Commit Message Format](#commit-message-format)
- [Example types](#example-types)
- [Scope](#scope)
- [Subject](#subject)
- [Tagging your project](#tagging-your-project)
- [ROADMAP](#roadmap)
- [v2.0.0](#v200-1)
- [Release History](#release-history)
- [v1.0.0](#v100-1)
- [Contributors](#contributors)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->


## Breaking changes
## Breaking changes and updates


### v2.0.0

Included `commit_template` option, allows to customize commit outputs.

You can use the following commit properties:
- commit.subject
- commit.body
- commit.link
- commit.hash
- commit.breaks
- commit.type
- commit.component
- closes: String containing the issues closed
- link: Link to the commit
- ~~commit.author~~

# V1.0.0

Since version `1.0.0` git-changelog has included the [`.changelogrc` specification](#changelogrc-specification) and has discontinued the next options:
- `grep_commits` option has been removed in favour of the `.changelogrc` options
Expand All @@ -51,6 +70,7 @@ Since version `1.0.0` git-changelog has included the [`.changelogrc` specificati
- `version_name` instead of `version`



**ATTENTION: Help wanted, there are some easy issues that you can contribute to. WINK WINK**


Expand All @@ -70,6 +90,7 @@ This specification is used to grep the commits on your log, it contains a valid
"version_name" : "v1.0.0",
"file": "CHANGELOG.md",
"template": "myCustomTemplate.md",
"commit_template": "myCommitTemplate.md"
"sections": [
{
"title": "Bug Fixes",
Expand Down Expand Up @@ -121,8 +142,9 @@ This specification is used to grep the commits on your log, it contains a valid
* **repo_url** : The url of the project. For issues and commits links. Defaults to `git config --get remote.origin.url`
* **provider** : Optional field, the provider is calculated from the repo_url, but can also be passed as config parameter. Values available: gitlab, github, bitbucket.
* **version_name**: The version name of the project.
* **file**: The name of the file that will be generated. Defaults to `CHANGELOG.md`,
* **file**: The name of the file that will be generated. Defaults to `CHANGELOG.md`, leave empty for console stream
* **template**: The template for generating the changelog. It defaults to the one inside this project (/templates/template.md)
* **commit_template**: The template for printing each of the commits of the project. It defaults to the one inside this project (/templates/commit_template.md)
* **app_name** : The name of the project. Defaults to `My App - Changelog`
* **intro** : The introduction text on the header of the changelog. Defaults to `null`
* **logo** : A logo URL to be included in the header of the changelog. Defaults to `null`
Expand Down Expand Up @@ -226,23 +248,24 @@ Use it directly with the common options
Usage: git-changelog [options]
Options:
-V, --version output the version number
-e, --extended Extended log
-n, --version_name [version_name] Name of the version
-a, --app_name [app_name] Name [app_name]
-b, --branch [branch] Branch name [branch]
-f, --file [file] File [file]
-tpl, --template [template] Template [template]
-ctpl, --commit_template [commit_template] Commit Template [commit_template]
-r, --repo_url [repo_url] Repo url [repo_url]
-l, --logo [logo] Logo path [logo]
-i, --intro [intro] intro text [intro]
-t, --tag [tag] Since tag [tag]
-rc, --changelogrc [changelogrc] .changelogrc relative path [changelogrc]
-g, --grep [grep] Grep commits for [grep]
-d, --debug Debugger
-p, --provider [provider] Provider: gitlab, github, bitbucket (Optional)
-h, --help output usage information
-h, --help output usage information
-V, --version output the version number
-e, --extended Extended log
-n, --version_name [version_name] Name of the version
-a, --app_name [app_name] Name [app_name]
-b, --branch [branch] Branch name [branch]
-f, --file [file] File [file]
-tpl, --template [template] Template [template]
-r, --repo_url [repo_url] Repo url [repo_url]
-l, --logo [logo] Logo path [logo]
-i, --intro [intro] intro text [intro]
-t, --tag [tag] Since tag [tag]
-rc, --changelogrc [changelogrc] .changelogrc relative path [changelogrc]
-g, --grep [grep] Grep commits for [grep]
-d, --debug Debugger
-p, --provider [provider] Provider: gitlab, github, bitbucket (Optional)
```

Expand Down
Loading

0 comments on commit 06eebc4

Please sign in to comment.