I'd like to have some way to prevent certain code from being committed in the first place.
E.g. when I have a line saying
printf("debug: now at: %d\n", i); /* DONTCOMMIT */
then when I type "git commit ...", a script will be invoked that will recognize the "DONTCOMMIT" string, and it will abort the commit.