3

I'm fixing some commit messages of a series of commits. I start

git rebase --interactive

mark some commits for rewording and then edit the messages. It'd be really helpful if I could see the diff of each commit in the editor, just like when doing git commit -v. Is something like this possible with rebase?

(I could also just edit the commits and then see the diffs, but this is much slower and less convenient.)

Petr
  • 62,528
  • 13
  • 153
  • 317

1 Answers1

1

You could write a prepare-commit-msg hook to add more information to the suggested message before the editor starts. You can tell that you're in a rebase by looking at certain state files that get created in .git. You could regenerate the diffs, but the patches for all of the commits unwound by rebase are in a subdirectory of .git.

Ben Jackson
  • 90,079
  • 9
  • 98
  • 150