thatidiotguy
thatidiotguy

Reputation: 9011

Script to Stop Git Commits if //TODO comments Are Present in Changes

I am relatively new to using Git and I was wondering if there was a nifty way to prevent git commit from running if it detects any //TODO statements in the changes that you are attempting to commit.

IntelliJ used to detect this for me when I did SVN commits, but I would like to know the best way to accomplish this on the command line.

Upvotes: 1

Views: 962

Answers (1)

merlin2011
merlin2011

Reputation: 75589

You want to write and install a pre-commit hook which looks for // TODO in changes and returns a non-zero exit status if it finds that string.

Upvotes: 3

Related Questions