Documentation ¶
Index ¶
- Constants
- Variables
- type Git
- func (g *Git) DefaultRemote() (string, error)
- 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) Root() string
- func (g *Git) Show(commit string) (TimeData, error)
- func (g *Git) Staging() (map[string]*StagedFile, error)
- type StagedFile
- 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 ErrNoRemote = errors.New("Version control has no remote")
View Source
var ErrNoRemoteTimeData = errors.New("Remote doesn't have any time data")
View Source
var PostCommitTmpl = template.Must(template.New("name").Parse(`#!/bin/sh
#persist (punch) to newly created commit and reset the timer
glass -s status -t "{{"{{"}}.{{"}}"}}" | glass punch
glass reset
`))
View Source
var PrePushTmpl = template.Must(template.New("name").Parse(`#!/bin/sh
#push time data
glass push $1
`))
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)
# -m method
printf "$(cat $1)$(glass -s status --commit-template)" > "$1" ;;
"")
# interactive method
printf "$(glass -s status --commit-template)\n$(cat $1)" > "$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 ¶
type StagedFile ¶ added in v0.6.1
type StagedFile struct {
// contains filtered or unexported fields
}
func NewStagedFile ¶ added in v0.6.1
func NewStagedFile(date time.Time, hash, path string) *StagedFile
func (*StagedFile) Date ¶ added in v0.6.1
func (sf *StagedFile) Date() time.Time
func (*StagedFile) Hash ¶ added in v0.6.1
func (sf *StagedFile) Hash() string
func (*StagedFile) Path ¶ added in v0.6.1
func (sf *StagedFile) Path() string
func (*StagedFile) SetDate ¶ added in v0.6.1
func (sf *StagedFile) SetDate(t time.Time)
Click to show internal directories.
Click to hide internal directories.