Skip to content

Commit

Permalink
refactor: Refactor branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
rafinskipg committed May 8, 2016
1 parent f6111d3 commit 8774b96
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<img width="300px" src="https://github.com/rafinskipg/git-changelog/raw/master/images/git-changelog-logo.png" />

__Git changelog__

_Git changelog is a utility tool for generating changelogs. It is free and opensource. :)_
__my name__

# (2016-05-08)

Expand Down Expand Up @@ -55,6 +51,10 @@ _Git changelog is a utility tool for generating changelogs. It is free and opens

## Chore

- Remove grunt from peer dependencies
([f6111d31](https://github.com/rafinskipg/git-changelog/commit/f6111d31f0c70f8368d2a57ea708bf58990f6bfd))
- Updated jshint
([1d5f6b1d](https://github.com/rafinskipg/git-changelog/commit/1d5f6b1d471e9d48ac2b4c7c8b78e3e5a8021ff4))
- typos and grammar
([5ae2ee52](https://github.com/rafinskipg/git-changelog/commit/5ae2ee52d1f096d375d077299047684eae2cd5e2))
- **cleanup:**
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,10 @@ This specification is used to grep the commits on your log, it contains a valid
"app_name": "Git Changelog",
"logo": "https://github.com/rafinskipg/git-changelog/raw/master/images/git-changelog-logo.png",
"intro": "Git changelog is a utility tool for generating changelogs. It is free and opensource. :)",
"branch_name" : "",
"branch" : "",
"repo_url": "",
"version" : '',
"version" : "v1.0.0",
"file": 'CHANGELOG.md',

tag: null,


debug: false,
"sections": [
{
"title": "Bug Fixes",
Expand Down Expand Up @@ -114,7 +109,7 @@ This specification is used to grep the commits on your log, it contains a valid

### Options | Defaults

* **branch_name** : The name of the branch. Defaults to ` `
* **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
* **file**: The name of the file that will be generated. Defaults to `CHANGELOG.md`,
Expand All @@ -132,7 +127,7 @@ This specification is used to grep the commits on your log, it contains a valid
### Grunt Task

#### Getting Started
This plugin requires Grunt `~0.4.1`
This plugin requires Grunt `1.0.0`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

Expand Down Expand Up @@ -165,6 +160,7 @@ grunt.initConfig({
options: {
app_name : 'Git changelog extended',
file : 'EXTENDEDCHANGELOG.md',
version : 'squeezy potatoe',
sections : [
{
"title": "Test commits",
Expand Down Expand Up @@ -213,7 +209,7 @@ Use it directly with the common options
-V, --version output the version number
-e, --extended Extended log
-a, --app_name [app_name] Name [app_name]
-b, --branch [branch_name] Branch name [branch_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]
Expand Down Expand Up @@ -331,13 +327,17 @@ npm version patch -m "chore(release): %s codename(furious-stallman)"

## ROADMAP

### v0.3.0
### v2.0.0
- Downloadable resources area on the generated changelog, for linking to your zip project folder of certain tag.

![Evolution](http://1.bp.blogspot.com/-YgUV9XTA9Rk/UVHhe4vJA-I/AAAAAAAAEyg/RPL3sjMQb0k/s1600/scala-naturae-robots.png)

## Release History
_(Nothing yet)_

### v1.0.0

- Support for `.changelogrc`


## Contributors

Expand Down
6 changes: 3 additions & 3 deletions tasks/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (process.argv.join('').replace(/\\/g,'/').indexOf('/grunt') === -1) {
.version('0.1.7')
.option('-e, --extended', 'Extended log')
.option('-a, --app_name [app_name]', 'Name [app_name]')
.option('-b, --branch [branch_name]', 'Branch name [branch_name]')
.option('-b, --branch [branch]', 'Branch name [branch]')
.option('-f, --file [file]', 'File [file]')
.option('-r, --repo_url [repo_url]', 'Repo url [repo_url]')
.option('-l, --logo [logo]', 'Logo path [logo]')
Expand All @@ -37,8 +37,8 @@ if (process.argv.join('').replace(/\\/g,'/').indexOf('/grunt') === -1) {
options.app_name = program.app_name;
}

if (program.branch_name){
options.branch_name = program.branch_name;
if (program.branch){
options.branch = program.branch;
console.log(' - Branch %s', program.branch);
}
if (program.debug){
Expand Down
2 changes: 1 addition & 1 deletion tasks/defaults.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Defaults options
module.exports = {
branch_name : '',
branch : '',
//[G]ithub [B]itbucket supported at the momment
repo_url: '',
version : '',
Expand Down
4 changes: 2 additions & 2 deletions tasks/lib/get-gitlog-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var debug = require('debug')('changelog:getGitLogCommands');

function getGitLogCommands() {
debug('getting log commands');
this.cmd.gitLog = 'git log ' + this.options.branch_name + ' --grep="%s" -E --format=%s %s..HEAD';
this.cmd.gitLogNoTag = 'git log ' + this.options.branch_name + ' --grep="%s" -E --format=%s';
this.cmd.gitLog = 'git log ' + this.options.branch + ' --grep="%s" -E --format=%s %s..HEAD';
this.cmd.gitLogNoTag = 'git log ' + this.options.branch + ' --grep="%s" -E --format=%s';
}

module.exports = getGitLogCommands;
10 changes: 5 additions & 5 deletions test/git_changelog_generate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ describe('git_changelog_generate.js', function() {
changelog.setDefaults();
});

it('should generate "git log" commands for "branch_name"', function() {
var branch_name = 'master';
changelog.options.branch_name = branch_name;
it('should generate "git log" commands for "branch"', function() {
var branch = 'master';
changelog.options.branch = branch;
changelog.getGitLogCommands();

expect(changelog.cmd.gitLog).to.include('git log ' + branch_name);
expect(changelog.cmd.gitLogNoTag).to.include('git log ' + branch_name);
expect(changelog.cmd.gitLog).to.include('git log ' + branch);
expect(changelog.cmd.gitLogNoTag).to.include('git log ' + branch);
});

});
Expand Down

0 comments on commit 8774b96

Please sign in to comment.