diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc7375..0b9665b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,13 @@ _Git changelog is a utility tool for generating changelogs. It is free and opens +## Documentation + - updating documentation with template info + ([70fb9774](https://github.com/rafinskipg/git-changelog/commit/70fb97742ea2182a9d25ca92d6eeab081b44cc63)) + + + + --- *Generated with [git-changelog](https://github.com/rafinskipg/git-changelog). If you have any problems or suggestions, create an issue.* :) **Thanks** diff --git a/EXTENDEDCHANGELOG.md b/EXTENDEDCHANGELOG.md index 6fa157a..0676c7f 100644 --- a/EXTENDEDCHANGELOG.md +++ b/EXTENDEDCHANGELOG.md @@ -100,6 +100,8 @@ _Git changelog is a utility tool for generating changelogs. It is free and opens ## Documentation + - updating documentation with template info + ([70fb9774](https://github.com/rafinskipg/git-changelog/commit/70fb97742ea2182a9d25ca92d6eeab081b44cc63)) - Updated readme with the correct specification ([ec2de4bf](https://github.com/rafinskipg/git-changelog/commit/ec2de4bf599dfc77c24c9b86ee9c0d86fe37e5b8)) - Updated options and tagging info diff --git a/README.md b/README.md index 8c9ef68..dc09890 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,9 @@ 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 -- `tag = false`, in addition to pick logs from the begining of the project, now groups the commits by tag [see example]. **TODO** -- `tag = false` && `group=false` will log from the begining of the project, without grouping by tag **TODO** - `repo_url` fixed as parameter - `branch_name` changed to `branch` +- `version_name` instead of `version` ## `.changelogrc` specification @@ -61,7 +60,7 @@ This specification is used to grep the commits on your log, it contains a valid "intro": "Git changelog is a utility tool for generating changelogs. It is free and opensource. :)", "branch" : "", "repo_url": "", - "version" : "v1.0.0", + "version_name" : "v1.0.0", "file": "CHANGELOG.md", "template": "myCustomTemplate.md", "sections": [ @@ -113,7 +112,7 @@ This specification is used to grep the commits on your log, it contains a valid * **branch** : The name of the branch. Defaults to ` ` * **repo_url** : The url of the project. For issues and commits links. Defaults to `git config --get remote.origin.url` -* **version**: The version of the project. Defaults to ` `, *DEPRECATED* will default to the tag name +* **version_name**: The version name of the project. * **file**: The name of the file that will be generated. Defaults to `CHANGELOG.md`, * **template**: The template for generating the changelog. It defaults to the one inside this project (/templates/template.md) * **app_name** : The name of the project. Defaults to `My App - Changelog` @@ -163,7 +162,7 @@ grunt.initConfig({ options: { app_name : 'Git changelog extended', file : 'EXTENDEDCHANGELOG.md', - version : 'squeezy potatoe', + version_name : 'squeezy potatoe', sections : [ { "title": "Test commits", @@ -193,7 +192,7 @@ grunt.initConfig({ file: 'output/customTemplate.md', template: 'templates/template_two.md', logo : 'https://github.com/rafinskipg/git-changelog/raw/master/images/git-changelog-logo.png', - version : 'squeezy potatoe', + version_name : 'squeezy potatoe', tag: 'v0.0.1', debug: true } @@ -220,19 +219,21 @@ Use it directly with the common options Options: - -h, --help output usage information - -V, --version output the version number - -e, --extended Extended log - -a, --app_name [app_name] Name [app_name] - -b, --branch [branch] Branch name [branch] - -f, --file [file] File [file] - -r, --repo_url [url] Repo url [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 + -h, --help output usage information + -V, --version output the version number of the package + -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 ``` diff --git a/output/customTemplate.md b/output/customTemplate.md index 6ab1309..3f57de0 100644 --- a/output/customTemplate.md +++ b/output/customTemplate.md @@ -55,6 +55,7 @@ _This changelog is generated with a custom template_ ## Documentation + - updating documentation with template info (70fb97742ea2182a9d25ca92d6eeab081b44cc63 - Updated readme with the correct specification (ec2de4bf599dfc77c24c9b86ee9c0d86fe37e5b8 - Updated options and tagging info (1ad3b6bedc6431b70e3a2e93e5967bad9a7830ee - added documentation for explaining the commit message (d516c2fb464072fc1f4c86ec71a910eeab3e830c diff --git a/tasks/command.js b/tasks/command.js index 40fe12d..838885b 100755 --- a/tasks/command.js +++ b/tasks/command.js @@ -36,7 +36,7 @@ if (process.argv.join('').replace(/\\/g,'/').indexOf('/grunt') === -1) { } if (program.version_name){ - options.versionName = program.version_name; + options.version_name = program.version_name; } if (program.app_name){ diff --git a/tasks/defaults.js b/tasks/defaults.js index 6a285cc..5bc5a76 100644 --- a/tasks/defaults.js +++ b/tasks/defaults.js @@ -3,7 +3,7 @@ module.exports = { branch : '', //[G]ithub [B]itbucket supported at the momment repo_url: '', - version : '', + version_name : '', file: 'CHANGELOG.md', app_name : 'My app - Changelog', tag: null, diff --git a/tasks/lib/generate.js b/tasks/lib/generate.js index e8aa36c..4934d7f 100644 --- a/tasks/lib/generate.js +++ b/tasks/lib/generate.js @@ -5,14 +5,14 @@ var debug = require('debug')('changelog:generate'); function generateFromCommits(commits, sections) { this.message('parsed commits', commits.length); this.log('debug', 'Parsed', commits.length, 'commits'); - this.log('info','Generating changelog to', this.options.file || 'stdout', '(', this.options.version, ')'); + this.log('info','Generating changelog to', this.options.file || 'stdout', '(', this.options.version_name, ')'); return this.writeChangelog(commits, sections); } function generateFromTag(tag) { var readGitLog; - + if (typeof(tag) !== 'undefined' && tag && tag !== false) { this.log('info', 'Reading git log since', tag); this.message('since tag', tag); diff --git a/tasks/lib/get-previous-tag.js b/tasks/lib/get-previous-tag.js index 0537168..c4b3020 100644 --- a/tasks/lib/get-previous-tag.js +++ b/tasks/lib/get-previous-tag.js @@ -5,6 +5,8 @@ var child = require('child_process'); function cmdDone(resolve, reject, code, stdout, stderr) { debug('returning from git tag'); + //I think this command it's actually not working and always return empty + // Consider trying git describe --abbrev=0 --tags if (code) { reject(); } else { diff --git a/tasks/lib/init-options.js b/tasks/lib/init-options.js index b2f7e7e..d97d8ea 100644 --- a/tasks/lib/init-options.js +++ b/tasks/lib/init-options.js @@ -19,7 +19,7 @@ function initOptions(params) { this.message('logo', this.options.logo); this.message('sections', this.options.sections); this.message('debug', this.options.debug); - this.message('version', this.options.version); + this.message('version_name', this.options.version_name); this.message('changelogrc', this.options.changelogrc); } diff --git a/tasks/lib/print-header.js b/tasks/lib/print-header.js index 8c8845b..607cfd3 100644 --- a/tasks/lib/print-header.js +++ b/tasks/lib/print-header.js @@ -7,7 +7,7 @@ var format = require('util').format; var logoTemplate = '\n\n'; var titleTemplate = '__%s__\n\n'; var subtitleTemplate = '_%s_\n\n'; -var versionTemplate = '# %s %s (%s)\n\n'; +var versionTemplate = '# %s (%s)\n\n'; function printHeader(stream, options, date) { @@ -22,7 +22,7 @@ function printHeader(stream, options, date) { stream.write(format(subtitleTemplate, options.intro)); } - stream.write(format(versionTemplate, options.version || '', options.versionName || '', date)); + stream.write(format(versionTemplate, options.version_name || '', date)); stream.write('\n\n---\n'); } diff --git a/tasks/lib/write-change-log.js b/tasks/lib/write-change-log.js index 76ad217..62fe8df 100644 --- a/tasks/lib/write-change-log.js +++ b/tasks/lib/write-change-log.js @@ -33,7 +33,7 @@ function writeChangelog(commits) { title: module.options.app_name, version:{ number: module.options.tag, - name: module.options.name + name: module.options.version_name } }; diff --git a/test/git_changelog_generate.spec.js b/test/git_changelog_generate.spec.js index 9c5e42a..5b44d4d 100644 --- a/test/git_changelog_generate.spec.js +++ b/test/git_changelog_generate.spec.js @@ -126,10 +126,10 @@ describe('git_changelog_generate.js', function() { expect(changelog.options.msg).to.contain('debug: test'); }); - it('should store "version" if passed as an option', function() { - changelog.initOptions({ version: 'test' }); - expect(changelog.options.version).to.equal('test'); - expect(changelog.options.msg).to.contain('version: test'); + it('should store "version_name" if passed as an option', function() { + changelog.initOptions({ version_name: 'test' }); + expect(changelog.options.version_name).to.equal('test'); + expect(changelog.options.msg).to.contain('version_name: test'); }); it('should store any other option, but not save in msg', function() { @@ -469,7 +469,7 @@ describe('git_changelog_generate.js', function() { sinon.stub(changelog, 'printSection'); sinon.stub(changelog, 'printHeader'); - changelog.initOptions({ app_name: 'app', version: 'version', sections: sections, template: false }); + changelog.initOptions({ app_name: 'app', version_name: 'version_name', sections: sections, template: false }); changelog.writeChangelog(this.commits) .then(function() { done(); @@ -571,7 +571,7 @@ describe('git_changelog_generate.js', function() { sinon.stub(changelog, 'printSection'); sinon.stub(changelog, 'printHeader'); - changelog.initOptions({ app_name: 'app', version: 'version', sections: sections, template:false }); + changelog.initOptions({ app_name: 'app', version_name: 'version_name', sections: sections, template:false }); changelog.writeChangelog(this.commits).then(function() { done(); });