merge

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchAndMergeSHAs

func FetchAndMergeSHAs(gitter gitclient.Interface, shas []string, baseBranch, baseSha, remote, dir string, extraMergeArgs []string) error

FetchAndMergeSHAs merges any SHAs into the baseBranch which has a tip of baseSha, fetching the commits from remote for the git repo in dir. It will try to fetch individual commits ( if the remote repo supports it - see https://github. com/git/git/commit/68ee628932c2196742b77d2961c5e16360734a62) otherwise it uses git remote update to pull down the whole repo.

func LocalBranches

func LocalBranches(g gitclient.Interface, dir string) ([]string, error)

LocalBranches will list all local branches

func ToRegexOrNil

func ToRegexOrNil(text string) (*regexp.Regexp, error)

ToRegexOrNil returns a regex for non-blank strings or returns an error if it cannot be parsed

Types

type Options

type Options struct {
	UserName             string
	UserEmail            string
	SHAs                 []string
	GitMergeArgs         []string
	Remote               string
	Dir                  string
	BaseBranch           string
	BaseSHA              string
	PullRefs             string
	PullNumber           string
	IncludeCommitComment string
	ExcludeCommitComment string
	Rebase               bool
	DisableInClusterTest bool

	CommandRunner cmdrunner.CommandRunner
	GitClient     gitclient.Interface
}

Options the options for the command

func NewCmdGitMerge

func NewCmdGitMerge() (*cobra.Command, *Options)

NewCmdGitMerge creates a command object for the command

func (*Options) FindCommitsToMerge

func (o *Options) FindCommitsToMerge() ([]string, error)

func (*Options) RebaseToBaseSHA added in v0.2.97

func (o *Options) RebaseToBaseSHA() error

func (*Options) Run

func (o *Options) Run() error

Run implements the command

func (*Options) Validate

func (o *Options) Validate() error

Validate validates the inputs are valid

type Pair added in v0.3.21

type Pair struct {
	Key string
	SHA string
}

type PullRefs

type PullRefs struct {
	BaseBranch string
	BaseSha    string
	ToMerge    []Pair
}

PullRefs is the result of parsing the Prow PULL_REFS

func ParsePullRefs

func ParsePullRefs(pullRefs string) (*PullRefs, error)

ParsePullRefs parses the Prow PULL_REFS env var formatted string and converts to a map of branch:sha

func (*PullRefs) String

func (pr *PullRefs) String() string

Jump to

Keyboard shortcuts

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