├── .gitignore ├── Makefile ├── README.md ├── bin ├── gpbegin ├── gpend └── gpinvoice ├── lib └── gp.sh └── man └── man1 ├── gpbegin.1 ├── gpbegin.1.ronn ├── gpend.1 ├── gpend.1.ronn ├── gpinvoice.1 └── gpinvoice.1.ronn /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | prefix=/usr/local 2 | bindir=${prefix}/bin 3 | libdir=${prefix}/lib 4 | mandir=${prefix}/share/man 5 | 6 | all: 7 | 8 | clean: 9 | 10 | install: 11 | install -d $(DESTDIR)$(bindir) 12 | install bin/gpbegin bin/gpend bin/gpinvoice $(DESTDIR)$(bindir)/ 13 | install -d $(DESTDIR)$(libdir) 14 | install -m644 lib/gp.sh $(DESTDIR)$(libdir)/ 15 | install -d $(DESTDIR)$(mandir)/man1 16 | install -m644 man/man1/gpbegin.1 man/man1/gpend.1 man/man1/gpinvoice.1 \ 17 | $(DESTDIR)$(mandir)/man1/ 18 | 19 | uninstall: 20 | rm -f \ 21 | $(DESTDIR)$(bindir)/gpbegin \ 22 | $(DESTDIR)$(bindir)/gpend \ 23 | $(DESTDIR)$(bindir)/gpinvoice \ 24 | $(DESTDIR)$(libdir)/gp.sh \ 25 | $(DESTDIR)$(mandir)/man1/gpbegin.1 \ 26 | $(DESTDIR)$(mandir)/man1/gpend.1 \ 27 | $(DESTDIR)$(mandir)/man1/gpinvoice.1 28 | rmdir -p --ignore-fail-on-non-empty \ 29 | $(DESTDIR)$(bindir) \ 30 | $(DESTDIR)$(libdir) \ 31 | $(DESTDIR)$(mandir) 32 | 33 | 34 | man: 35 | find man -name \*.ronn | xargs -n1 ronn --manual=Git\ Paid --style=toc 36 | 37 | gh-pages: man 38 | mkdir -p gh-pages 39 | find man -name \*.html | xargs -I__ mv __ gh-pages/ 40 | git checkout -q gh-pages 41 | cp -R gh-pages/* ./ 42 | rm -rf gh-pages 43 | git add . 44 | git commit -m "Rebuilt manual." 45 | git push origin gh-pages 46 | git checkout -q master 47 | 48 | .PHONY: all clean install uninstall man gh-pages 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Git Paid, the programmer's time tracker 2 | ======================================= 3 | 4 | Git Paid is a console time tracking program that stores work logs in Git. Currently, it assumes begin and end commits are accurate in time and uses this to generate an invoice. In the future, user-supplied billable hours will be supported. 5 | 6 | See [`gpbegin`(1)](http://rcrowley.github.com/gitpaid/gpbegin.1.html), [`gpend`(1)](http://rcrowley.github.com/gitpaid/gpend.1.html), and [`gpinvoice`(1)](http://rcrowley.github.com/gitpaid/gpinvoice.1.html) for more details if this example isn't enough for you. 7 | 8 | $ gpbegin -b client-name 9 | $ ... 10 | $ gpend -b client-name -m "Shaved the yak." 11 | $ gpbegin -b client-name 12 | $ gpend -b client-name -t 1:45 -m "Faked the time." 13 | $ gpinvoice -b client-name 14 | # Invoice 15 | 16 | Thu Jan 6 18:27:32 UTC 2011 17 | from client-name branch of /home/vagrant/.gitpaid 18 | 19 | ## Work log 20 | 21 | Began: Thu, 6 Jan 2011 16:17:29 +0000 22 | 23 | > Shaved the yak. 24 | 25 | Ended: Thu, 6 Jan 2011 17:47:42 +0000 26 | Billed time: 1:30 27 | 28 | Began: Thu, 6 Jan 2011 18:27:23 +0000 29 | 30 | > Faked the time. 31 | 32 | Ended: Thu, 6 Jan 2011 18:27:25 +0000 33 | Billed time (adjusted): 1:45 34 | 35 | ## Summary 36 | 37 | Total billed time: 3:15 38 | -------------------------------------------------------------------------------- /bin/gpbegin: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | #/ Usage: gpbegin [-r] -b [-m] 6 | #/ -r repository path (default ~/.gitpaid) 7 | #/ -b branch name 8 | #/ -m commit message (default empty) 9 | #/ -h show this help message 10 | 11 | . "$(dirname "$(dirname "$0")")/lib/gp.sh" 12 | 13 | while getopts m:b:r:h NAME 14 | do 15 | case "$NAME" in 16 | m) MESSAGE="$OPTARG";; 17 | b) BRANCH="$OPTARG";; 18 | r) REPO="$OPTARG";; 19 | *) usage;; 20 | esac 21 | done 22 | 23 | gpinit 24 | 25 | gpcommit "$MESSAGE" 26 | -------------------------------------------------------------------------------- /bin/gpend: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | #/ Usage: gpend [-r] -b [-t