Last active
February 27, 2020 13:48
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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