Truncate commit messages more reliably