Skip to content

Commit

Permalink
More robust log separators
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Sep 9, 2016
1 parent c4f318d commit adc1dcc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/commits.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import find from 'array.prototype.find'

find.shim()

const COMMIT_SEPARATOR = '===COMMIT_SEPARATOR==='
const MESSAGE_SEPARATOR = '---MESSAGE_SEPARATOR---'
const COMMIT_SEPARATOR = '__AUTO_CHANGELOG_COMMIT_SEPARATOR__'
const MESSAGE_SEPARATOR = '__AUTO_CHANGELOG_MESSAGE_SEPARATOR__'

export const LOG_FORMAT = COMMIT_SEPARATOR + '%H%n%D%n%aI%n%an%n%ae%n%B' + MESSAGE_SEPARATOR

Expand Down
40 changes: 20 additions & 20 deletions test/data/git-log.js
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
export default `===COMMIT_SEPARATOR===b0b304049847d9568585bc11399fa6cfa4cab5dc
export default `__AUTO_CHANGELOG_COMMIT_SEPARATOR__b0b304049847d9568585bc11399fa6cfa4cab5dc
HEAD -> master, origin/master
2015-12-29T21:57:19+00:00
Pete Cook
email@example.com
Unreleased commit
Fixes #6
---MESSAGE_SEPARATOR---
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
5 files changed, 10 insertions(+), 10 deletions(-)
===COMMIT_SEPARATOR===db92947e6129cc20cd7777b7ed90b2bd547918c0
__AUTO_CHANGELOG_COMMIT_SEPARATOR__db92947e6129cc20cd7777b7ed90b2bd547918c0
tag: v0.1.0
2015-12-29T21:19:17+00:00
Pete Cook
email@example.com
0.1.0
---MESSAGE_SEPARATOR---
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
2 files changed, 8 insertions(+), 2 deletions(-)
===COMMIT_SEPARATOR===12c0624e7e419a70bd5f3b403d7e0bd8f23ec617
__AUTO_CHANGELOG_COMMIT_SEPARATOR__12c0624e7e419a70bd5f3b403d7e0bd8f23ec617
2015-12-29T21:18:19+00:00
Pete Cook
email@example.com
Commit that fixes nothing
---MESSAGE_SEPARATOR---
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
1 files changed, 2 insertions(+), 3 deletions(-)
===COMMIT_SEPARATOR===ef17dcc732d282f027aa3bddf8f91cbb05998cc8
__AUTO_CHANGELOG_COMMIT_SEPARATOR__ef17dcc732d282f027aa3bddf8f91cbb05998cc8
tag: v0.0.2
2015-12-28T21:17:17+00:00
Pete Cook
email@example.com
0.0.2
---MESSAGE_SEPARATOR---
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
2 files changed, 8 insertions(+), 2 deletions(-)
===COMMIT_SEPARATOR===0e24bf427a51eac52133cc731b4b5d74a7e04672
__AUTO_CHANGELOG_COMMIT_SEPARATOR__0e24bf427a51eac52133cc731b4b5d74a7e04672
2015-12-24T20:29:22+00:00
Pete Cook
email@example.com
Merge pull request #5 from repo/branch
Should not parse #4 in PR title
---MESSAGE_SEPARATOR---
===COMMIT_SEPARATOR===17fbef87e82889f01d8257900f7edc55b05918a2
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
__AUTO_CHANGELOG_COMMIT_SEPARATOR__17fbef87e82889f01d8257900f7edc55b05918a2
2015-12-28T11:35:54+00:00
Pete Cook
email@example.com
Commit 4 fixes #4 in the subject
With some extra notes here
---MESSAGE_SEPARATOR---
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
1 file changed, 1 insertion(+)
===COMMIT_SEPARATOR===796edd129a6aaea148dcd72ea897321e66cae0c1
__AUTO_CHANGELOG_COMMIT_SEPARATOR__796edd129a6aaea148dcd72ea897321e66cae0c1
tag: v0.0.1
2015-12-15T12:03:09+00:00
Pete Cook
email@example.com
0.0.1
---MESSAGE_SEPARATOR---
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
2 files changed, 8 insertions(+), 2 deletions(-)
===COMMIT_SEPARATOR===31b7d3da24d64e32a0a7e558f254d01c348613f3
__AUTO_CHANGELOG_COMMIT_SEPARATOR__31b7d3da24d64e32a0a7e558f254d01c348613f3
2015-12-15T11:37:05+00:00
Pete Cook
email@example.com
Merge pull request #3 from repo/branch
Pull request title
---MESSAGE_SEPARATOR---
===COMMIT_SEPARATOR===90ef33485369fc7892d11b2e4da04ffb64df1e99
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
__AUTO_CHANGELOG_COMMIT_SEPARATOR__90ef33485369fc7892d11b2e4da04ffb64df1e99
2015-12-15T11:31:06+00:00
Pete Cook
email@example.com
Second commit
Resolves #1 and fixes https://github.com/user/repo/issues/2
---MESSAGE_SEPARATOR---
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
8 files changed, 57 insertions(+), 53 deletions(-)
===COMMIT_SEPARATOR===158fdde54b6188c9f9ca3034e9cb5bcc3fe3ff69
__AUTO_CHANGELOG_COMMIT_SEPARATOR__158fdde54b6188c9f9ca3034e9cb5bcc3fe3ff69
2015-12-14T17:06:12+00:00
Pete Cook
email@example.com
First commit
---MESSAGE_SEPARATOR---
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
7 files changed, 37 insertions(+), 22 deletions(-)
`

0 comments on commit adc1dcc

Please sign in to comment.