Besides Emacs itself, Magit is the greatest tool in my arsenal for making clean patches and making me a more productive programmer in general. It's made doing more advanced git tasks so much easier, interactive rebasing and staging/unstaging hunks in particular. Can't live without it.