I have a commit-msg hook that I run for all of my local commits and, for a certain project, I require to have been run. Problem is, when I pull in from other forks some of my compatriots have not run this commit-msg hook. To date I’ve been doing
$ git rebase --interactive $commit_parent
as outlined very similarly here. Pick the commits that haven’t been done properly, re-edit and so on. All very workable, but also tedious as I’m doing it by hand.
How can I automate this? The hook requires no oversight.
This can be achieved in automatic fashion using custom editor:
and then running:
On the first invocation, our “editor” will get a list of commits from
rebase -i, where it will change everypicktor(which isreword). In this modegitwill start immediately calling our “editor” with a message of every rebased commit (and without any pauses that it usually makes inpickmode where you can change your commit itself).