git

package
v1.1.1-0...-dcff8be Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersionNumbers

func CompareVersionNumbers(version1, version2 Version) int

CompareVersionNumbers compares the two version numbers provided as input the result is as follows - 0, if version1 == version2 1, if version1 > version2 -1, if version1 < version2

func ExecCmd

func ExecCmd(dir string, name string, arg ...string) ([]byte, error)

ExecCmd is used to execute a git command in the given directory

func GetBranchesForCommit

func GetBranchesForCommit(repoDir, sha string) (branches []string, err error)

GetBranchesForCommit gets the branches where the commit belong

func GetCommitHash

func GetCommitHash(repoDir string) (hash string, err error)

GetCommitHash gets the commit hash of the current branch

func GetPlannerVersions

func GetPlannerVersions() []macrobench.PlannerVersion

func ShortenSHA

func ShortenSHA(sha string) string

ShortenSHA will return the first 7 characters of a SHA. If the given SHA is too short, it will be returned untouched.

Types

type PRInfo

type PRInfo struct {
	Number int
	Base   string
	SHA    string
}

func GetPullRequestsFromGitHub

func GetPullRequestsFromGitHub(labels []string, repo string) ([]PRInfo, error)

GetPullRequestsFromGitHub fetches every pull requests in the provided repo that have the given set of labels. It then returns each pull request's head SHA. The format for repo is: "{USERNAME}/{REPO_NAME}", i.e "vitessio/vitess".

type Release

type Release struct {
	Name       string
	CommitHash string
	Version    Version
	RCnumber   int
}

func GetAllVitessReleaseBranchCommitHash

func GetAllVitessReleaseBranchCommitHash(repoDir string) ([]*Release, error)

GetAllVitessReleaseBranchCommitHash gets all the vitess release branches and the commit hashes given the directory of the clone of vitess

func GetAllVitessReleaseCommitHash

func GetAllVitessReleaseCommitHash(repoDir string) ([]*Release, error)

GetAllVitessReleaseCommitHash gets all the vitess releases and the commit hashes given the directory of the clone of vitess

func GetLastPatchReleaseAndCommitHash

func GetLastPatchReleaseAndCommitHash(repoDir string, version Version) (*Release, error)

GetLastPatchReleaseAndCommitHash gets the last release number given the major and minor release number along with the commit hash given the directory of the clone of vitess

func GetLastReleaseAndCommitHash

func GetLastReleaseAndCommitHash(repoDir string) (*Release, error)

GetLastReleaseAndCommitHash gets the last release number along with the commit hash given the directory of the clone of vitess

func GetLatestVitessReleaseBranchCommitHash

func GetLatestVitessReleaseBranchCommitHash(repoDir string) ([]*Release, error)

GetLatestVitessReleaseBranchCommitHash gets the latest vitess release branches and the commit hashes given the directory of the clone of vitess

func GetLatestVitessReleaseCommitHash

func GetLatestVitessReleaseCommitHash(repoDir string) ([]*Release, error)

GetLatestVitessReleaseCommitHash gets the lastest major vitess releases and the commit hashes given the directory of the clone of vitess

type Version

type Version struct {
	Major, Minor, Patch int
}

func GetVersionForCommitSHA

func GetVersionForCommitSHA(repoDir, sha string) (Version, error)

Jump to

Keyboard shortcuts

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