#!/bin/sh
#
# git-today - show commits for today
#
# ---
# source: https://github.com/davidosomething/dotfiles/blob/dev/bin/git-today

author="${1:-${GIT_AUTHOR_EMAIL:-${GIT_COMMITTER_EMAIL}}}"
[ -z "${author}" ] && author="$(git config --includes --global user.email)"
[ -z "${author}" ] && exit 1

printf "%s's commits today:\n" "${author}"
git log --since=00:00:00 \
  --all --no-merges --oneline \
  --author="${author}"
