Skip to content

Instantly share code, notes, and snippets.

@d
Last active February 21, 2021 19:23
Show Gist options
  • Save d/30c7988ae62ca7a7ee18900647225ae1 to your computer and use it in GitHub Desktop.
Save d/30c7988ae62ca7a7ee18900647225ae1 to your computer and use it in GitHub Desktop.
when did this function become dead?
#!/bin/bash
set -e -u -o pipefail
pretty_log() {
git --no-pager log --color --abbrev=16 --abbrev-commit --topo-order -n8 -S "${func_name}" -- '*.cpp' '*.h' '*.inl'
}
count_occurrences() {
git --no-pager log --abbrev=16 --pretty=tformat:%h -n8 -S "${func_name}" -- '*.cpp' '*.h' '*.inl' | parallel -qj1 --load 125% -X git grep -cwF "${func_name}" {} -- '*.cpp' '*.h' '*.inl'
}
_main() {
local cmd func_name
cmd=$1
func_name=$2
case "${cmd}" in
both)
echo "${func_name}"
printf '%s\n' log count | parallel -q --load 125% "$0" {} "${func_name}"
;;
log)
pretty_log
;;
count)
count_occurrences
;;
esac
}
_main "$@"
@d
Copy link
Author

d commented Feb 21, 2021

time printf '%s\n' AddMinAggs FSupportsMinAgg PexprEqualityOnBoolColumn PexprAssertUpdateCardinality PpartcnstrUpdateCovered | parallel -P 63% hack/when-was-it-dead both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment