f4shwg
Last Updated: April 13, 2016
·
4.94K
· ksi

Git for Daily Standup

Working on several branches I had to find out what I've done the last workday. Here's my alias for .gitconfig

standup = !"git log --reverse --branches --since=$(if [[ "Mon" == "$(date +%a)" ]]; then echo "last friday"; else echo "yesterday"; fi) --author=$(git config --get user.email) --format=format:'%C(cyan) %ad %C(yellow)%h %Creset %s %Cgreen%d' --date=local"

You have to call

git standup

on every repo you're on.

Precondition: set up your email in .gitconfig.

Remark: I had to use the ! notation because of adding shell functionality. Using a bash function didn't work - git doesn't load it somehow.

Now I'm working on a (inhouse) github version to get all things I've done.

3 Responses
Add your response

4633

You can also make a script and call it git-filename and make sure it's on your path, then you call it with git filename from shell. Instead of using the bang.
There is no need for an alias with this method.

over 1 year ago ·
4658

Yes, I know. I always try to start small, then it grows...
In this case it would be more readable. However, I like to have my git (related) commands as compact as possible.
Let's see.
Thanks for reminding me.

over 1 year ago ·
6837

Great work but you got a bug in the alias :) It don't work on Mondays.

standup = !"git log --reverse --branches --since='$(if [[ "Mon" == "$(date +%a)" ]]; then echo "last friday"; else echo "yesterday"; fi)' --author=$(git config --get user.email) --format=format:'%C(cyan) %ad %C(yellow)%h %Creset %s %Cgreen%d' --date=local"
over 1 year ago ·
Filed Under