Created
November 30, 2015 16:40
-
-
Save avk/36c02ddb777a6ccdadc7 to your computer and use it in GitHub Desktop.
two bash helper functions for searching git commit messages and commit history
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
function commit_messages { | |
if [ -z "$1" ] | |
then | |
echo "Please pass in a string to search for in all of this repository's log messages." | |
else | |
echo "Searching commit messages for \"$1\"" | |
git log --grep "$1" --all | |
fi | |
} | |
function commit_history { | |
if [ -z "$1" ] | |
then | |
echo "Please pass in a string to search for in all of this repository's commits." | |
else | |
echo "Searching commit history for \"$1\"" | |
git log -S "$1" --all | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment