Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
 - func CommitIDs(limiter CommitLimiter, wd ...string) ([]string, error)
 - func ConfigRemove(settings map[string]string, wd ...string) error
 - func ConfigSet(settings map[string]string, wd ...string) error
 - func CreateNote(noteTxt string, nameSpace string, wd ...string) error
 - func GitRepoPath(path ...string) (string, error)
 - func IgnoreRemove(ignore string, wd ...string) error
 - func IgnoreSet(ignore string, wd ...string) error
 - func RemoveHooks(hooks map[string]GitHook, p string) error
 - func SetHooks(hooks map[string]GitHook, wd ...string) error
 - func Workdir(gitRepoPath string) (string, error)
 - type Commit
 - type CommitLimiter
 - type CommitNote
 - type CommitStats
 - type GitHook
 - type Status
 
Constants ¶
This section is empty.
Variables ¶
var ( // ErrHeadUnborn is raised when there are no commits yet in the git repo ErrHeadUnborn = errors.New("Head commit not found") )
Functions ¶
func CommitIDs ¶
func CommitIDs(limiter CommitLimiter, wd ...string) ([]string, error)
CommitIDs returns commit SHA1 IDs starting from the head up to the limit
func ConfigRemove ¶
ConfigRemove removes git configuration settings
func CreateNote ¶
CreateNote creates a git note associated with the head commit
func GitRepoPath ¶ added in v1.3.4
GitRepoPath discovers .git directory for a repo
func IgnoreRemove ¶
IgnoreRemove removes paths/files ignored for a git repo
func RemoveHooks ¶
RemoveHooks remove matching git hook commands
Types ¶
type Commit ¶
type Commit struct {
	ID      string
	OID     *git.Oid
	Summary string
	Message string
	Author  string
	Email   string
	When    time.Time
	Files   []string
	Stats   CommitStats
}
    Commit contains commit details
func HeadCommit ¶
HeadCommit returns the latest commit
type CommitLimiter ¶ added in v1.2.1
type CommitLimiter struct {
	Max        int
	DateRange  util.DateRange
	Before     time.Time
	After      time.Time
	Author     string
	Message    string
	HasMax     bool
	HasBefore  bool
	HasAfter   bool
	HasAuthor  bool
	HasMessage bool
}
    CommitLimiter struct filter commits by criteria
func NewCommitLimiter ¶ added in v1.2.0
func NewCommitLimiter( max int, fromDateStr, toDateStr, author, message string, today, yesterday, thisWeek, lastWeek, thisMonth, lastMonth, thisYear, lastYear bool) (CommitLimiter, error)
NewCommitLimiter returns a new initialize CommitLimiter struct
type CommitNote ¶
type CommitNote struct {
	ID      string
	OID     *git.Oid
	Summary string
	Message string
	Author  string
	Email   string
	When    time.Time
	Note    string
	Stats   CommitStats
}
    CommitNote contains a git note's details
type CommitStats ¶ added in v1.2.1
CommitStats contains the files changed and their stats
func DiffParentCommit ¶ added in v1.2.1
func DiffParentCommit(childCommit *git.Commit) (CommitStats, error)
DiffParentCommit compares commit to it's parent and returns their stats
func (CommitStats) ChangeRatePerHour ¶ added in v1.2.1
func (c CommitStats) ChangeRatePerHour(seconds int) float64
ChangeRatePerHour calculates the rate change per hour
type GitHook ¶ added in v1.2.5
GitHook is the Command with options to be added/removed from a git hook Exe is the executable file name for Linux/MacOS RE is the regex to match on for the command
type Status ¶
type Status struct {
	Files []fileStatus
}
    Status contains the git file statuses
func (*Status) AddFile ¶
func (s *Status) AddFile(e git.StatusEntry)
AddFile adds a StatusEntry for each file in working and staging directories
func (*Status) IsModified ¶
IsModified returns true if the file is modified in either working or staging