git_common

package
v0.0.0-...-b945540 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RollBranch is the git branch which is used to create rolls.
	RollBranch = "roll_branch"
)

Variables

This section is empty.

Functions

func Clone

func Clone(ctx context.Context, repoUrl, dest string, rev *revision.Revision) error

Clone clones the given repo into the given destination and syncs it to the given Revision.

Types

type ApplyExternalChangeFunc

type ApplyExternalChangeFunc func(context.Context, git.Checkout, string) error

ApplyExternalChangeFunc applies the specified ExternalChangeId in whichever way makes sense for the implementation. Example: git_checkout_github uses the ExternalChangeId as a Github PR and cherry-picks the PR patch locally.

type Checkout

type Checkout struct {
	git.Checkout
	Branch *config_vars.Template

	Dependencies []*config.VersionFileConfig
	RepoURL      string
	RevLinkTmpl  string
	// contains filtered or unexported fields
}

Checkout provides common functionality for git checkouts.

func NewCheckout

func NewCheckout(ctx context.Context, c *config.GitCheckoutConfig, reg *config_vars.Registry, workdir, userName, userEmail string, co git.Checkout) (*Checkout, error)

NewCheckout returns a Checkout instance.

func (*Checkout) CreateNewRoll

func (c *Checkout) CreateNewRoll(ctx context.Context, from, to *revision.Revision, rolling []*revision.Revision, emails []string, dryRun bool, commitMsg string, createRoll CreateRollFunc, uploadRoll UploadRollFunc) (int64, error)

CreateNewRoll uploads a new roll using the given createRoll and uploadRoll functions. See documentation for the Parent interface for more details.

func (*Checkout) Download

func (c *Checkout) Download(ctx context.Context, rev *revision.Revision, dest string) error

Download implements Child.

func (*Checkout) GetRevision

func (c *Checkout) GetRevision(ctx context.Context, id string) (*revision.Revision, error)

GetRevision implements Child.

func (*Checkout) LogRevisions

func (c *Checkout) LogRevisions(ctx context.Context, from, to *revision.Revision) ([]*revision.Revision, error)

LogRevisions implements Child.

func (*Checkout) Update

func (c *Checkout) Update(ctx context.Context) (*revision.Revision, string, error)

Update resolves the configured branch template, updates the Checkout to the newest Revision on the resulting branch and returns both the revision and resolved branch name.

type CreateRollFunc

CreateRollFunc generates commit(s) in the local Git checkout to be used in the next roll and returns the hash of the commit to be uploaded. GitCheckoutParent handles creation of the roll branch.

type UploadRollFunc

type UploadRollFunc func(context.Context, git.Checkout, string, string, []string, bool, string) (int64, error)

UploadRollFunc uploads a CL using the given commit hash and returns its ID.

Jump to

Keyboard shortcuts

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