Last active
February 23, 2021 13:58
-
-
Save CodyKochmann/eeb21b8db2880ad0ee5f0459e70c49c5 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# opens a ugrep interface to search every commit of a git repo | |
# by: Cody Kochmann | |
set -euxo pipefail | |
REPO="$@" | |
TMP_WORK_DIR=$(mktemp -d) | |
pushd "$TMP_WORK_DIR" | |
git clone "$REPO" .repo | |
pushd .repo | |
git log | awk '/^commit / {print($2)}' | xargs -n 1 bash -c 'cp -r . ../$0 && cd ../$0 && git checkout $0' | |
popd | |
mv .repo repo | |
ugrep . --recursive -i -E -Q | |
popd | |
rm -rf "$TMP_WORK_DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment