Last active
August 29, 2015 14:22
-
-
Save twobitlabs/561a86f06be21370a9d4 to your computer and use it in GitHub Desktop.
search diff commits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git-search-diffs() { | |
if [ -z "$2" ] | |
then | |
echo "Use git-search-diffs to search for commits where the diff includes the search term" | |
echo "Usage: git-search-diffs <path> <search term>" | |
return | |
fi | |
git log -p $1 | egrep -i "^commit|^[-+].*$2" | egrep -B1 ^[+-] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment