63b7e5767d551b1d839888a7216f2bed01e8eb1f

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix(changelog): don't parse commits of ignored types

Diff

 1diff --git a/tools/changelog.sh b/tools/changelog.sh
 2index 7329a9526f9a68186fc878cb78f94af351cbdf73..71caa2b6c267323008446554aa359148371b7826 100755
 3--- a/tools/changelog.sh
 4+++ b/tools/changelog.sh
 5@@ -120,7 +120,7 @@ function parse-commit {
 6   fi
 7 
 8   # Parse commit with hash $1
 9-  local hash="$1" subject body warning rhash
10+  local hash="$1" subject body type warning rhash
11   subject="$(command git show -s --format=%s $hash)"
12   body="$(command git show -s --format=%b $hash)"
13 
14@@ -132,8 +132,12 @@ function parse-commit {
15   #  commit body
16   #  [BREAKING CHANGE: warning]
17 
18+  # if commit type is not going to be displayed, do nothing else
19+  type="$(commit:type "$subject")"
20+  (( ${MAIN_TYPES[(Ie)$type]} || ${OTHER_TYPES[(Ie)$type]} )) || return
21+
22   # commits holds the commit type
23-  commits[$hash]="$(commit:type "$subject")"
24+  commits[$hash]="$type"
25   # scopes holds the commit scope
26   scopes[$hash]="$(commit:scope "$subject")"
27   # subjects holds the commit subject