From 379534ce600a4b39f3ae5ae5426cb49becbf8828 Mon Sep 17 00:00:00 2001 From: Oliver Davies <339813+opdavies@users.noreply.github.com> Date: Tue, 21 May 2024 17:44:01 +0100 Subject: [PATCH] Count characters, not just lines --- git-commit-length-counter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-commit-length-counter.sh b/git-commit-length-counter.sh index 98d9758..533ba6e 100755 --- a/git-commit-length-counter.sh +++ b/git-commit-length-counter.sh @@ -27,7 +27,7 @@ if [[ ! -f "${result_file}" ]]; then # Calculate the legnth of the commit message. commit_message=$(GIT_PAGER=cat git -C "${REPO}" show "${commit_id}" -s --format=%B) - commit_message_length=$(echo "${commit_message}" | wc -l) + commit_message_length=$(echo "${commit_message}" | wc --chars) # Store the commit IDs and the message length. echo "${commit_message_length} ${commit_id}" >> "${result_file}"