Skip to content

Instantly share code, notes, and snippets.

@e-sung
Last active February 27, 2020 13:48
Show Gist options
  • Save e-sung/af17ec5d739463fd1752cf414639c8a0 to your computer and use it in GitHub Desktop.
Save e-sung/af17ec5d739463fd1752cf414639c8a0 to your computer and use it in GitHub Desktop.
Shell Script that Generates List of Git Commit Messages of All branches on a given day
#! /usr/local/bin/zsh
authorName="Sungdoo Yoo" #Put your Name here
dayStart="8am" #Put the time when you start your day
for refName in $(git for-each-ref --format='%(refname)' refs/heads/);
do
boilerPlateToRemove="refs/heads/"
branchName="${refName//$boilerPlateToRemove/""}"
result=""
git log --author="$authorName" --since="$dayStart" $branchName| read result
size=${#result}
if [ $size -gt 0 ]
then
echo "========================"
echo $branchName
echo "========================"
prettyLog=$(git log --pretty="%s" --reverse --since="$dayStart" --author="$authorName" $branchName| cat)
echo $prettyLog
echo "\n"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment