Last active
February 5, 2021 15:27
-
-
Save fredlahde/18a577ac3265759b4a4b8a1da43258f0 to your computer and use it in GitHub Desktop.
Git review
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-review() { | |
local search="$1" | |
local commits=$(git --no-pager log --all --oneline --grep=$search | cut -d ' ' -f1 | paste -sd ' ') | |
if [ -z "$commits" ] | |
then | |
echo "No commits found for $search" | |
else | |
git show --pretty=short --show-signature $(echo $commits) | vim - | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Greps the git log for commits which messages contain a given keyword. Those are then opened in vim