I recently converted an svn repository with git svn. Unfortunately the svn history has a number of empty commit messages. This is a problem when I rebase and
git svn
If you have multiple lines you could also use cat:
git filter-branch -f --msg-filter \ 'msg=$(cat); if [ "$msg" = "" ]; then echo "Here was an empty commit message"; else echo "$msg"; fi'
This handles commit messages with multiple lines as well as messages that contain empty lines for spacing.