Skip to content

Instantly share code, notes, and snippets.

@tinifni
Created September 20, 2012 16:04
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tinifni/3756796 to your computer and use it in GitHub Desktop.
Save tinifni/3756796 to your computer and use it in GitHub Desktop.
Remember what you've done since your last standup
# zsh script checks first if there were any commits done
# by author yesterday. If there were, return those. If
# there weren't, look for all commits since last Friday
# at midnight as it may have been a weekend.
#
# Use your name in the --author for all commands
gitstandup() {
if [ -z "$(git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=yesterday.midnight)" ]; then
git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=last.friday.midnight;
else
git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=yesterday.midnight;
fi
}
alias gtsu='gitstandup'
@ConorSheehan1
Copy link

Awesome script!
I made a variation here: https://gist.github.com/ConorSheehan1/f6da062b536c633622e1aa438aa64593

Changes:

  1. Get user with git config user.email
  2. Pass extra args to functions with $@
  3. Add example git aliases (in comments)
  4. Add explicit day check using GNU coreutils date (in comments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment