In my current development environment, when I run git rebase in interactive mode (--interactive) it will often open vi and prompt me to make changes to some text file as a way for me to tell it how to handle the rebase. vi highlights these files in a way that seems to be determined by git. (Keywords like ‘pick’, ‘squash’, etc that have special meaning to git in this context are highlighted with different colors.)
I prefer to use emacs over vi, so I configured git to open emacs instead (git config --global core.editor "emacs -nw"). Unfortunately, emacs doesn’t highlight the file provided by git like vi does. How can I fix this?
Edit:
In case you aren’t familiar with the file generated by an interactive git rebase, here is an example:
pick f218f23 A major overhaul of the cucumber integration tests
pick 601d8f4 A bunch of minor bug fixes and refactoring
pick 1adc507 Adding and updating documentation for various files.
# Rebase ff8cb22..1adc507 onto ff8cb22
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
c:\my_project\.git\rebase-merge\git-rebase-todo [unix] (15:50 26/10/2012)
In this example, the keyword ‘pick’, the revision hashes, the commit descriptions, and the comments would all be highlighted different colors.
Either there’s a mode for it already somewhere out there (e.g as part of magit), or else someone will have to write one for it (should be fairly easy, if you show us some sample content, as well as some hint about what kind of file name they have).