vcs

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2015 License: MPL-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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 NewGit

func NewGit(dir string) *Git

func (*Git) DefaultRemote

func (g *Git) DefaultRemote() string

func (*Git) Fetch added in v0.5.0

func (g *Git) Fetch(remote string) error

func (*Git) Hook

func (g *Git) Hook() error

func (*Git) Log added in v0.5.0

func (g *Git) Log(t time.Duration) error

func (*Git) Name

func (g *Git) Name() string

func (*Git) Push

func (g *Git) Push(remote string, refs string) error

func (*Git) Supported added in v0.3.1

func (g *Git) Supported() bool

type VCS

type VCS interface {
	Name() string
	Supported() bool
	Hook() error
	Push(string, string) error
	Fetch(string) error
	DefaultRemote() string
	Log(time.Duration) error
}

func GetVCS

func GetVCS(dir string) (VCS, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL