Created
May 3, 2014 05:12
-
-
Save legumbre/38c78887110502dbdc4d to your computer and use it in GitHub Desktop.
find commit containing blob with hash
This file contains hidden or 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
#!/bin/sh | |
obj_name="$1" | |
shift | |
git log "$@" --pretty=format:'%T %h %s' \ | |
| while read tree commit subject ; do | |
if git ls-tree -r $tree | grep -q "$obj_name" ; then | |
echo $commit "$subject" | |
fi | |
done | |
# | |
# ./findcommitforblob deadbeef master | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment