Skip to content

Instantly share code, notes, and snippets.

@CodyKochmann
Last active February 23, 2021 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodyKochmann/eeb21b8db2880ad0ee5f0459e70c49c5 to your computer and use it in GitHub Desktop.
Save CodyKochmann/eeb21b8db2880ad0ee5f0459e70c49c5 to your computer and use it in GitHub Desktop.
#!/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