I have a relatively large feature branch, in which I've added a lot of printf style debugging (as well as a lot of other additions of course.)
I'd like a way to find which files I've added printf statements to.
At the moment I use something like
git diff master | grep printf | grep "^+" This gives an output like
+ printf("Debug %d\n", i); + printf("Another debug\n"); Then I can search for each of those lines in my entire project... sigh.
Or I could use git log master..HEAD -G printf but that shows me a lot of additional context that I just dont need.
I would love a way to get grep like output from git like this: (hypothetical only)
> git magic-grep master -e "printf" /some/path/foo.c:65: printf("Debug %d\n", i); /someother/path/bar.c:123: printf("Another debug\n"); then my editor would be happy and I would be much more efficient.
Is there a way to pass git a magical incantation to make it do something like this? Or are there additional scripts to make it work?