Advertisement
Guest User

Untitled

a guest
Jul 15th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # Git Timetracker. Copyright Kevin van Zonneveld (kvz.io)
  3. # License under MIT
  4. #
  5. # This file
  6. #
  7. # - can be run inside a git repository to get a list on what hours work took place (for billing)
  8. # - takes 1 argument: since. It defaults to "2 months"
  9. #
  10. # Usage:
  11. #
  12. # cd repo
  13. # git-timetracker.sh 1 month
  14. #
  15. # Remarks:
  16. #
  17. # - Since we can't use a custom dateformat but really want to, the hack is to
  18. # use iso format, and add backspace characters (%x08)
  19. #
  20. # Possible output:
  21. #
  22. # 2013-03-30 14:02 4bf9607 kevin@vanzonneveld.net Allow the egrep to fail without bailing out
  23. # 2013-03-28 01:29 9120b9e kevin@vanzonneveld.net When cron fails, fallback to fallback nameservers :) Fixes #1
  24. # 2013-03-27 13:42 d0b0df2 kevin@vanzonneveld.net Improve docs
  25. # 2013-03-27 13:10 68c4314 kevin@vanzonneveld.net Initial import of dns-failover.sh
  26.  
  27. set -o pipefail
  28. set -o errexit
  29. set -o nounset
  30. # set -o xtrace
  31.  
  32. # Optionally set how long to travel back in time
  33. since="${@:-2 months}"
  34.  
  35. git --no-pager log \
  36. --date=iso \
  37. --since="${since}" \
  38. --date-order \
  39. --full-history \
  40. --all \
  41. --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