Finally, a solution that allows M-q to work nicely on commit messages.