function grep_git_history() {
local term="${@}"
git grep -e "${term}" $(git log -S "${term}" --pretty=format:"%H")
}
grep_git_history 'var = 1'
grep_git_history '{% url'
git diff --name-only HEAD $(git merge-base HEAD HEAD^)
Useful for CI jobs to skip if files for an directory are not updated. For example to run tests just if there are commits in src/frontend
if [[ ! -z $(git diff --name-only HEAD $(git merge-base HEAD HEAD^) | grep src/frontend) ]];
then
npm install;
npm run test;
fi