util

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotCommit = fmt.Errorf("one or both of the provided commits was not a valid commit")
View Source
var SupportedHosts = map[string]int{
	"bitbucket.org":     3,
	"code.google.com":   3,
	"github.com":        3,
	"golang.org":        3,
	"google.golang.org": 2,
	"gopkg.in":          2,
	"k8s.io":            2,
	"speter.net":        2,
}

supportedHosts maps source hosts to the number of path segments that represent the account/repo for that host. This is necessary because we can't tell just by looking at an import path whether the repo is identified by the first 2 or 3 path segments.

If dependencies are introduced from new hosts, they'll need to be added here.

View Source
var UpstreamSummaryPattern = regexp.MustCompile(`UPSTREAM: (revert: [a-f0-9]{7,}: )?(([\w\.-]+\/[\w-\.-]+)?: )?(\d+:|<carry>:|<drop>:)`)

Functions

func Checkout added in v1.1.5

func Checkout(commit, repoDir string) error

func CommitDate added in v1.1.5

func CommitDate(commit, repoDir string) (string, error)

func CurrentRev added in v1.1.5

func CurrentRev(repoDir string) (string, error)

func IsAncestor added in v1.1.3

func IsAncestor(commit1, commit2, repoDir string) (bool, error)

func IsCommit added in v1.3.0

func IsCommit(a string) bool

Types

type Commit

type Commit struct {
	Sha     string
	Summary string
	Files   []File
}

func CommitsBetween

func CommitsBetween(a, b string) ([]Commit, error)

func NewCommitFromOnelineLog

func NewCommitFromOnelineLog(log string) (Commit, error)

func (Commit) DeclaredUpstreamRepo

func (c Commit) DeclaredUpstreamRepo() (string, error)

func (Commit) DeclaresUpstreamChange

func (c Commit) DeclaresUpstreamChange() bool

func (Commit) GodepsReposChanged

func (c Commit) GodepsReposChanged() ([]string, error)

func (Commit) HasGodepsChanges

func (c Commit) HasGodepsChanges() bool

func (Commit) HasNonGodepsChanges

func (c Commit) HasNonGodepsChanges() bool

func (Commit) MatchesUpstreamSummaryPattern

func (c Commit) MatchesUpstreamSummaryPattern() bool

type File

type File string

func (File) GodepsRepoChanged

func (f File) GodepsRepoChanged() (string, error)

func (File) HasGodepsChanges

func (f File) HasGodepsChanges() bool

Jump to

Keyboard shortcuts

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