Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cookpete/auto-changelog
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0
Choose a base ref
...
head repository: cookpete/auto-changelog
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.1
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 27, 2017

  1. Update readme

    cookpete committed Oct 27, 2017
    Copy the full SHA
    54fc665 View commit details
  2. Copy the full SHA
    2a420f7 View commit details
  3. 1.0.1

    cookpete committed Oct 27, 2017
    Copy the full SHA
    6f41950 View commit details
Showing with 19 additions and 5 deletions.
  1. +5 −0 CHANGELOG.md
  2. +2 −1 README.md
  3. +1 −1 package.json
  4. +11 −3 src/releases.js
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

Generated by [auto-changelog](https://github.com/CookPete/auto-changelog).

#### [v1.0.1](https://github.com/CookPete/auto-changelog/compare/v1.0.0...v1.0.1)
> 27 October 2017
- Filter out commits with the same message as an existing merge [`2a420f7`](https://github.com/CookPete/auto-changelog/commit/2a420f793ac3b761291cfd5499676a80953cbee7)
- Update readme [`54fc665`](https://github.com/CookPete/auto-changelog/commit/54fc6659e9283b6d6afc95486893aa56df13111c)

#### [v1.0.0](https://github.com/CookPete/auto-changelog/compare/v0.3.6...v1.0.0)
> 27 October 2017
- Update dependencies to enable Greenkeeper 🌴 [`#10`](https://github.com/CookPete/auto-changelog/pulls/10)
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -17,9 +17,10 @@ If you are upgrading from `0.x`, the same options are still supported out of the
- If you still want to use the [`keepachangelog`](http://keepachangelog.com) format, use `--template keepachangelog`
- Templates now use `-` instead of `*` for lists
- Up to 3 commits are now shown per release
- Unreleased changes are no longer listed by default, use `--unreleased` to list them
- Unreleased changes are no longer listed by default, use `--unreleased` to include them
- [GitLab](https://gitlab.com) and [BitBucket](https://bitbucket.org) are now fully supported

If anything isn’t working correctly, [open an issue](https://github.com/CookPete/auto-changelog/issues).

### Installation

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auto-changelog",
"version": "1.0.0",
"version": "1.0.1",
"description": "Command line tool for generating a changelog from git tags and commit history",
"bin": {
"auto-changelog": "./lib/index.js"
14 changes: 11 additions & 3 deletions src/releases.js
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ export function parseReleases (commits, origin, packageVersion, includeUnrelease
fixes: commit.fixes,
commit
})
} else if (filterCommit(commit)) {
} else if (filterCommit(commit, release.merges)) {
release.commits.push(commit)
}
}
@@ -45,8 +45,16 @@ function newRelease (tag = null, date = new Date().toISOString()) {
return release
}

function filterCommit (commit) {
return !semver.valid(commit.subject) // Filter out version commits
function filterCommit (commit, merges) {
if (semver.valid(commit.subject)) {
// Filter out version commits
return false
}
if (merges.findIndex(m => m.message === commit.subject) !== -1) {
// Filter out commits with the same message as an existing merge
return false
}
return true
}

function getCompareLink (from, to, origin) {