Skip to content

Commit 589624b

Browse files
committed
"Removed formatting, truncated if necessary, enforced 72 char limit"
1 parent 1963d11 commit 589624b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

git-commit-push-script.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ if [ -z "$COMMIT_MSG" ]; then
3333
fi
3434

3535
# Clean up commit message formatting - remove #, ```, period . at the end of response
36-
commit_message=$(echo $COMMIT_MSG | sed 's/#//g' | sed 's/```//g' | sed 's/Commit message title://g' | sed 's/Commit message summary://g' | sed 's/\.//g' | head -n 1)
36+
commit_message=$(echo $COMMIT_MSG | sed 's/#//g' | sed 's/```//g' | sed 's/Commit message title://g' | sed 's/Commit message summary://g' | sed 's/\.//g')
3737

38-
# If the commit message is longer than 72 characters, truncate it at word boundary
38+
# If the commit message is longer than 72 characters, truncate it
3939
if [ ${#commit_message} -gt 72 ]; then
40-
# Truncate at the last word boundary before 72 characters
41-
commit_message=$(echo "$commit_message" | cut -c 1-72 | sed 's/\s\+[^\s]*$//')
40+
commit_message=${commit_message:0:72}...
4241
fi
4342

4443
# Echo the commit message

0 commit comments

Comments
 (0)