Is it possible to get git grep
to search only new or modified files in the index/cache?
(The use-case for this is to use in a pre-commit hook that looks for "debug" code such as console.log
in the prospective commit. But I'm not bothered by console.log
in "existing" code. Preferably this would also fail to match instances of console.log
that are removed, but I can live with those matching!)