Skip to content

Commit c26a705

Browse files
committed
Simplify comments
Change-Id: I585731a7b187785277627198aea814bf055529c7
1 parent 1d68fae commit c26a705

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

scripts/commit-msg.hook

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ WHITE=
1818
CYAN=
1919
NC=
2020

21-
#
2221
# Set colour variables if the output should be coloured.
23-
#
24-
2522
set_colors() {
2623
local default_color=$(git config --get hooks.goodcommit.color || git config --get color.ui || echo 'auto')
2724
if [[ $default_color == 'always' ]] || [[ $default_color == 'auto' && -t 1 ]]; then
@@ -34,10 +31,7 @@ set_colors() {
3431
fi
3532
}
3633

37-
#
3834
# Set the hook editor, using the same approach as git.
39-
#
40-
4135
set_editor() {
4236
# $GIT_EDITOR appears to always be set to `:` when the hook is executed by Git?
4337
# ref: http://stackoverflow.com/q/41468839/885540
@@ -49,10 +43,7 @@ set_editor() {
4943
test -z "${HOOK_EDITOR}" && HOOK_EDITOR='vi'
5044
}
5145

52-
#
5346
# Output prompt help information.
54-
#
55-
5647
prompt_help() {
5748
echo -e "${RED}$(cat <<-EOF
5849
e - edit commit message
@@ -62,20 +53,14 @@ EOF
6253
)${NC}"
6354
}
6455

65-
#
6656
# Add a warning with <line_number> and <msg>.
67-
#
68-
6957
add_warning() {
7058
local line_number=$1
7159
local warning=$2
7260
WARNINGS[$line_number]="${WARNINGS[$line_number]}$warning;"
7361
}
7462

75-
#
7663
# Output warnings.
77-
#
78-
7964
display_warnings() {
8065
if [ $SKIP_DISPLAY_WARNINGS -eq 1 ]; then
8166
# if the warnings were skipped then they should be displayed next time
@@ -98,10 +83,7 @@ EOF
9883
)${NC}"
9984
}
10085

101-
#
10286
# Read the contents of the commit msg into an array of lines.
103-
#
104-
10587
read_commit_message() {
10688
# reset commit_msg_lines
10789
COMMIT_MSG_LINES=()
@@ -159,10 +141,7 @@ get_all_match_positions() {
159141
done <<< "$targets"
160142
}
161143

162-
#
163144
# Validate the contents of the commmit msg agains the good commit guidelines.
164-
#
165-
166145
validate_commit_message() {
167146
# reset warnings
168147
WARNINGS=()
@@ -427,7 +406,6 @@ CHANGE_ID_AFTER="Bug|Issue|Test"
427406
MSG="$1"
428407

429408
# Ensure that a unique Change-Id is present, and generate one if it is not.
430-
#
431409
# Partially taken from Gerrit Code Review 3.3.0-56-gbcecc47463
432410
add_change_id() {
433411
clean_message=`sed -e '
@@ -578,9 +556,7 @@ _gen_changeid() {
578556
git hash-object -t commit --stdin
579557
}
580558

581-
#
582559
# It's showtime.
583-
#
584560

585561
set_colors
586562

0 commit comments

Comments
 (0)