Skip to content

Instantly share code, notes, and snippets.

@frebib
Forked from ChrisLane/recent-work.sh
Last active May 16, 2019 08:27
Show Gist options
  • Save frebib/c48cbd00d022e359816e4f5cf394d87d to your computer and use it in GitHub Desktop.
Save frebib/c48cbd00d022e359816e4f5cf394d87d to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
dir=${1:-"${HOME}/git/"}
since=${2:-"yesterday.midnight"}
author=${3:-"$(git config user.email)"}
repos=$(find "$dir" -mindepth 1 -maxdepth 1 -type d)
for project in ${repos}; do
if [ -e "$project/.git" ]; then
output="$(git -C "$project" log --author=${author} --since=${since})"
lines=$(echo "$output" | wc -l | xargs)
if [ ${lines} -gt 0 ]; then
echo "============================================================="
echo " ${project}"
echo "============================================================="
echo
echo ${output}
echo
echo
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment