At work, my team hosts a daily standup, in which we discuss what we're working on, what we did the day before and any potential blockers for future development.
I thought as a fun little side project that I would write a script in bash to go through each directory in my
/dev/ folder and get all commits from the previous day.
We use Git for the most part, but I do have one or two repositories still under a different source control system. This code is to mitigate that problem
Here is the code:
gitUsername="userNameHere" echo "Here are yesterday's commits:" for dir in ./*/ ; do (cd "$dir"; git log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cD) %C(bold blue)<%an>%Creset' --since yesterday --author $gitUsername} 2>> /dev/null;); done; echo "That's everything."
I have never written anything in bash before, so any suggestions would be much appreciated!
Also, just a side note in case anybody is interested, we don't read commits to measure workload, I am printing them more as a reminder of the things I was working on the day before.