Skip to content

Commit 01d74ba

Browse files
authored
Merge pull request #5 from Greewil/mirror_interval_error
Fix errors on mirror intervals
2 parents 76fae51 + e4d1b93 commit 01d74ba

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ To generate your own one line installer just follow the instructions after start
8686
-s, --short Don't show commit body in log messages
8787
Parameter won't work if you set your own format with '--format <your_format>'!
8888
--format <your_format> Set your own format for log message body.
89+
Default format is '(%cn)%n%n%b'.
8990
Format the same as for 'git --pretty=format:<your_format>'.
9091
(see more about git --pretty=format: here: https://git-scm.com/docs/pretty-formats)
9192

gen_release_notes.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#/ -s, --short Don't show commit body in log messages
2929
#/ Parameter won't work if you set your own format with '--format <your_format>'!
3030
#/ --format <your_format> Set your own format for log message body.
31+
#/ Default format is '(%cn)%n%n%b'.
3132
#/ Format the same as for 'git --pretty=format:<your_format>'.
3233
#/ (see more about git --pretty=format: here: https://git-scm.com/docs/pretty-formats)
3334
#/
@@ -50,7 +51,7 @@
5051
# Written by Shishkin Sergey <[email protected]>
5152

5253
# Current generator version
53-
RELEASE_NOTES_GENERATOR_VERSION='0.3.1'
54+
RELEASE_NOTES_GENERATOR_VERSION='0.3.2'
5455

5556
# all conventional commit types (Please don't modify!)
5657
CONVENTIONAL_COMMIT_TYPES=('build' 'ci' 'chore' 'docs' 'feat' 'fix' 'pref' 'refactor' 'revert' 'style' 'test')
@@ -175,7 +176,11 @@ function _collect_all_commits() {
175176
first_pointer=$(_get_latest_tag)
176177
SPECIFIED_INTERVAL="$first_pointer..${SPECIFIED_INTERVAL#*..}"
177178
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
179184
}
180185

181186
function _get_commit_info_by_hash() {
@@ -214,7 +219,7 @@ function _get_log_message() {
214219
}
215220

216221
function _generate_commit_groups() {
217-
while read -r commit_hash; do
222+
[[ "$ALL_COMMITS" != '' ]] && while read -r commit_hash; do
218223
commit_title=$(_get_commit_info_by_hash "$commit_hash" '%s')
219224
if [[ "$commit_title" =~ ^(build|ci|chore|docs|feat|fix|pref|refactor|revert|style|test)(\([a-z]+\))?!?:\ (.*) ]]; then
220225
type_index=$(_get_type_index_by_name "${BASH_REMATCH[1]}")

0 commit comments

Comments
 (0)