oscardelben/git-diff-grep — Issue #7: Diffing against checkout?
Author: tdavis
Created: 2011-12-30 21:25:36+00:00
State: open

The script seems to always be diffing against my checkout which means that if I do a grep against the past 100 commits and 50 commits into the history it finds one with a match, it will continue finding that same match and diff for the next 49 commits. I changed instances of ``git diff`` to ``git diff-tree -p`` to remedy this. I also changed the initial search to ``grep -q "^[+-].*$query.*"`` which ensures that source context doesn't cause a commit to match.

I feel like I may be missing something obvious or this is a platform-specific issue because the script flat doesn't do what it claims on my system. If these are actual bugs and not platform quirks I will be happy to create a pull request for the changes.