git

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstParent

func FirstParent(r *gogit.Repository, c *object.Commit) (*object.Commit, error)

FirstParent returns the first parent of a commit. For a merge commit this is the parent which is usually depicted on the left.

func FirstParentList

func FirstParentList(r *gogit.Repository, c *object.Commit) ([]*object.Commit, error)

FirstParentList visits the ancestors of c using the FirstParent func. It returns the list of visited commits.

func MergePoints

func MergePoints(r *gogit.Repository, mainLine []*object.Commit) (map[plumbing.Hash]*object.Commit, error)

MergePoints creates a look-up table from feature branch commit hashes to their merge commits onto the given mainline.

func SourceCommitToDstCommits

func SourceCommitToDstCommits(r *gogit.Repository, commitMsgTag string, dstFirstParents, srcFirstParents []*object.Commit) (map[plumbing.Hash]plumbing.Hash, error)

SourceCommitToDstCommits returns a mapping from all kube mainline commits to the corresponding dst commits after collapsing using "git filter-branch --sub-directory-filter":

dst upstream

|    |
F'<--F
z    |
y    |
E'<--E
x   ,D
|  / |
C'<--C
w    |
v<-, |
   |-B
    `A - initial commit

func SourceHash

func SourceHash(c *object.Commit, tag string) plumbing.Hash

SourceHash extracts kube commit from commit message The baseRepoName default to "kubernetes". TODO: Refactor so we take the commitMsgTag as argument and don't need to construct the ancientSyncCommitSubjectPrefix or sourceCommitPrefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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