Kris Hicks reassures us that the vim path through git interactive rebases need not lead to maddness. If you’d like to do an interactive rebase in your editor of choice (rather than Textmate, the Pivotal default) you can set the GIT_EDITOR flag. So go ahead to the terminal and
export GIT_EDITOR=vim && git rebase -i origin/master
Vim will launch, changes will be made, commits will be squashed, and all will be right with the world. Until you try to save; after making your changes and
:wq-ing, the terminal will admonish you
Could not execute editor.
The problem is a vi + Mac OS X + git incompatibility with pathogen (the vim package manager). To fix it, add the following lines to your .vimrc file:
filetype on filetype off ...pathogen crap... filetype on
For more on this issue, see http://andrewho.co.uk/weblog/vim-pathogen-with-mutt-and-git
Rayban reminds us that you best
yield before you exit the block.
around_save :check_something, :if => "my_attribute_changed?" def check_something return unless my_attribute == "foo" yield # do some stuff... end
will not save unless
my_attribute == "foo"— if your condition to run the around filter rarely happens you might not notice this fairly obvious behavior and be confused confused confused.