Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Git Timetracker. Copyright Kevin van Zonneveld (kvz.io)
- # License under MIT
- #
- # This file
- #
- # - can be run inside a git repository to get a list on what hours work took place (for billing)
- # - takes 1 argument: since. It defaults to "2 months"
- #
- # Usage:
- #
- # cd repo
- # git-timetracker.sh 1 month
- #
- # Remarks:
- #
- # - Since we can't use a custom dateformat but really want to, the hack is to
- # use iso format, and add backspace characters (%x08)
- #
- # Possible output:
- #
- # 2013-03-30 14:02 4bf9607 kevin@vanzonneveld.net Allow the egrep to fail without bailing out
- # 2013-03-28 01:29 9120b9e kevin@vanzonneveld.net When cron fails, fallback to fallback nameservers :) Fixes #1
- # 2013-03-27 13:42 d0b0df2 kevin@vanzonneveld.net Improve docs
- # 2013-03-27 13:10 68c4314 kevin@vanzonneveld.net Initial import of dns-failover.sh
- set -o pipefail
- set -o errexit
- set -o nounset
- # set -o xtrace
- # Optionally set how long to travel back in time
- since="${@:-2 months}"
- git --no-pager log \
- --date=iso \
- --since="${since}" \
- --date-order \
- --full-history \
- --all \
- --pretty=tformat:"%C(cyan)%ad%x08%x08%x08%x08%x08%x08%x08%x08%x08 %C(bold red)%h %C(bold blue)%<(22)%ae %C(reset)%s"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement