Since i switched to git from svn i started make more commits every time i recompile and my tests pass i commit my work. In the end i end up committing function by function.<
It really depends.
What I do is I commit locally often, as it sounds like you're doing, but I only push my changes when I've accrued several influential ones.
This ensures that I save my work, but it also doesn't clutter the repo for other users.