Documentation
¶
Index ¶
- Constants
- Variables
- type Git
- func (g *Git) DefaultRemote() string
- func (g *Git) Hook() error
- func (g *Git) IsAvailable() bool
- func (g *Git) Name() string
- func (g *Git) Persist(t time.Duration) error
- func (g *Git) Pull(remote string) error
- func (g *Git) Push(remote string, refs string) error
- func (g *Git) Show(commit string) (TimeData, error)
- type TimeData
- type VCS
Constants ¶
View Source
const (
TOTAL_PREFIX = "total="
)
Variables ¶
View Source
var ErrNoCommitTimeData = errors.New("Commit doesn't have any time data")
View Source
var ErrNoLocalTimeData = errors.New("Local clone doesn't have any time data")
View Source
var ErrNoRemoteTimeData = errors.New("Remote doesn't have any time data")
View Source
var PostCheckoutTmpl = template.Must(template.New("name").Parse(`#!/bin/sh
# when checkout is a branch, start timer
if [ $3 -eq 1 ]; then
glass start;
fi
`))
View Source
var PostCommitTmpl = template.Must(template.New("name").Parse(`#!/bin/sh
#always reset after commit
glass lap --from-hook
`))
View Source
var PrePushTmpl = template.Must(template.New("name").Parse(`#!/bin/sh
#push time data
glass push $1 --from-hook
`))
View Source
var PrepCommitTmpl = template.Must(template.New("name").Parse(`#!/bin/sh
# only add time to template and message sources
# @see http://git-scm.com/docs/githooks#_prepare_commit_msg
case "$2" in
message|template)
printf "$(cat $1)$(glass status --time-only)" > "$1" ;;
esac
`))
View Source
var TimeSpentNotesRef = "time-spent"
Functions ¶
This section is empty.
Types ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
func (*Git) DefaultRemote ¶
func (*Git) IsAvailable ¶
Click to show internal directories.
Click to hide internal directories.