|
28 | 28 | #/ -s, --short Don't show commit body in log messages |
29 | 29 | #/ Parameter won't work if you set your own format with '--format <your_format>'! |
30 | 30 | #/ --format <your_format> Set your own format for log message body. |
| 31 | +#/ Default format is '(%cn)%n%n%b'. |
31 | 32 | #/ Format the same as for 'git --pretty=format:<your_format>'. |
32 | 33 | #/ (see more about git --pretty=format: here: https://git-scm.com/docs/pretty-formats) |
33 | 34 | #/ |
|
50 | 51 | # Written by Shishkin Sergey <[email protected]> |
51 | 52 |
|
52 | 53 | # Current generator version |
53 | | -RELEASE_NOTES_GENERATOR_VERSION='0.3.1' |
| 54 | +RELEASE_NOTES_GENERATOR_VERSION='0.3.2' |
54 | 55 |
|
55 | 56 | # all conventional commit types (Please don't modify!) |
56 | 57 | CONVENTIONAL_COMMIT_TYPES=('build' 'ci' 'chore' 'docs' 'feat' 'fix' 'pref' 'refactor' 'revert' 'style' 'test') |
@@ -175,7 +176,11 @@ function _collect_all_commits() { |
175 | 176 | first_pointer=$(_get_latest_tag) |
176 | 177 | SPECIFIED_INTERVAL="$first_pointer..${SPECIFIED_INTERVAL#*..}" |
177 | 178 | fi |
178 | | - ALL_COMMITS="$(git log "$SPECIFIED_INTERVAL" --oneline --pretty=format:%H)" |
| 179 | + if [ "${SPECIFIED_INTERVAL%..*}" = "${SPECIFIED_INTERVAL#*..}" ]; then |
| 180 | + ALL_COMMITS='' |
| 181 | + else |
| 182 | + ALL_COMMITS="$(git log "$SPECIFIED_INTERVAL" --oneline --pretty=format:%H)" |
| 183 | + fi |
179 | 184 | } |
180 | 185 |
|
181 | 186 | function _get_commit_info_by_hash() { |
@@ -214,7 +219,7 @@ function _get_log_message() { |
214 | 219 | } |
215 | 220 |
|
216 | 221 | function _generate_commit_groups() { |
217 | | - while read -r commit_hash; do |
| 222 | + [[ "$ALL_COMMITS" != '' ]] && while read -r commit_hash; do |
218 | 223 | commit_title=$(_get_commit_info_by_hash "$commit_hash" '%s') |
219 | 224 | if [[ "$commit_title" =~ ^(build|ci|chore|docs|feat|fix|pref|refactor|revert|style|test)(\([a-z]+\))?!?:\ (.*) ]]; then |
220 | 225 | type_index=$(_get_type_index_by_name "${BASH_REMATCH[1]}") |
|
0 commit comments