Skip to content

Instantly share code, notes, and snippets.

@jstangroome
Created January 30, 2019 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstangroome/740db2673074ac41cf8866fab36db860 to your computer and use it in GitHub Desktop.
Save jstangroome/740db2673074ac41cf8866fab36db860 to your computer and use it in GitHub Desktop.
Find long commit messages
#!/bin/bash
while read -r commit_hash
do
message=$(
git cat-file commit "${commit_hash}" |
sed '1,/^$/d'
)
if [ "${message:0:5}" = 'Merge' ] || [ "${message:0:6}" = 'Revert' ]
then
continue
fi
if [ "${#message}" -gt 200 ]
then
printf '\n----------------\n%s\n' "${message}"
fi
done < <(git log --all --format=%H)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment