[Git] Improve hook about commit message length

I found this bug in this feature that I recently committed:
1. Write a commit message that is too long.
2. See the overflow text being printed red.
3. To make the message shorter, instead of deleting chars from
the end of the message, delete characters at the beginning or
the middle of the message.

Expected results: less characters should be marked as red.
Results before this commit: the red characters were moving
backwards.