git

package
v4.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToPerennialBranches

func AddToPerennialBranches(branchName string)

AddToPerennialBranches adds the given branch as a perennial branch

func CompileAncestorBranches

func CompileAncestorBranches(branchName string) (result []string)

CompileAncestorBranches calculates and returns the list of ancestor branches of the given branch based off the "git-town-branch.XXX.parent" configuration values.

func DeleteAllAncestorBranches

func DeleteAllAncestorBranches()

DeleteAllAncestorBranches removes all Git Town ancestor entries for all branches from the configuration.

func DeleteParentBranch

func DeleteParentBranch(branchName string)

DeleteParentBranch removes the parent branch entry for the given branch from the Git configuration.

func DoesBranchHaveUnmergedCommits

func DoesBranchHaveUnmergedCommits(branchName string) bool

DoesBranchHaveUnmergedCommits returns whether the branch with the given name contains commits that are not merged into the main branch

func EnsureBranchInSync

func EnsureBranchInSync(branchName, errorMessageSuffix string)

EnsureBranchInSync enforces that a branch with the given name is in sync with its tracking branch

func EnsureDoesNotHaveBranch

func EnsureDoesNotHaveBranch(branchName string)

EnsureDoesNotHaveBranch enforces that a branch with the given name does not exist

func EnsureDoesNotHaveConflicts

func EnsureDoesNotHaveConflicts()

EnsureDoesNotHaveConflicts asserts that the workspace has no unresolved merge conflicts.

func EnsureDoesNotHaveOpenChanges

func EnsureDoesNotHaveOpenChanges(message string)

EnsureDoesNotHaveOpenChanges assets that the workspace has no open changes

func EnsureHasBranch

func EnsureHasBranch(branchName string)

EnsureHasBranch enforces that a branch with the given name exists

func EnsureIsFeatureBranch

func EnsureIsFeatureBranch(branchName, errorSuffix string)

EnsureIsFeatureBranch asserts that the given branch is a feature branch.

func EnsureIsNotMainBranch

func EnsureIsNotMainBranch(branchName, errorMessage string)

EnsureIsNotMainBranch enforces that a branch with the given name is not the main branch

func EnsureIsNotPerennialBranch

func EnsureIsNotPerennialBranch(branchName, errorMessage string)

EnsureIsNotPerennialBranch enforces that a branch with the given name is not a perennial branch

func EnsureIsPerennialBranch

func EnsureIsPerennialBranch(branchName, errorMessage string)

EnsureIsPerennialBranch enforces that a branch with the given name is a perennial branch

func EnsureIsRepository

func EnsureIsRepository()

EnsureIsRepository asserts that the current directory is in a repository

func EnsureVersionRequirementSatisfied

func EnsureVersionRequirementSatisfied()

EnsureVersionRequirementSatisfied asserts that Git is the needed version or higher

func GetAncestorBranches

func GetAncestorBranches(branchName string) []string

GetAncestorBranches returns the names of all parent branches for the given branch, beginning but not including the parennial branch from which this hierarchy was cut. This information is read from the cache in the Git config, so might be out of date when the branch hierarchy has been modified.

func GetBranchSha

func GetBranchSha(branchName string) string

GetBranchSha returns the SHA1 of the latest commit on the branch with the given name.

func GetChildBranches

func GetChildBranches(branchName string) (result []string)

GetChildBranches returns the names of all branches for which the given branch is a parent.

func GetCurrentBranchName

func GetCurrentBranchName() string

GetCurrentBranchName returns the name of the currently checked out branch

func GetCurrentSha

func GetCurrentSha() string

GetCurrentSha returns the SHA of the currently checked out commit.

func GetExpectedPreviouslyCheckedOutBranch

func GetExpectedPreviouslyCheckedOutBranch(initialPreviouslyCheckedOutBranch, initialBranch string) string

GetExpectedPreviouslyCheckedOutBranch returns what is the expected previously checked out branch given the inputs

func GetGlobalConfigurationValue

func GetGlobalConfigurationValue(key string) (result string)

GetGlobalConfigurationValue returns the global git configuration value for the given key

func GetLocalAuthor

func GetLocalAuthor() string

GetLocalAuthor returns the locally Git configured user

func GetLocalBranches

func GetLocalBranches() (result []string)

GetLocalBranches returns the names of all branches in the local repository, ordered alphabetically

func GetLocalBranchesWithDeletedTrackingBranches

func GetLocalBranchesWithDeletedTrackingBranches() (result []string)

GetLocalBranchesWithDeletedTrackingBranches returns the names of all branches whose remote tracking branches have been deleted

func GetLocalBranchesWithMainBranchFirst

func GetLocalBranchesWithMainBranchFirst() (result []string)

GetLocalBranchesWithMainBranchFirst returns the names of all branches that exist in the local repository, ordered to have the name of the main branch first, then the names of the branches, ordered alphabetically

func GetMainBranch

func GetMainBranch() string

GetMainBranch returns the name of the main branch.

func GetParentBranch

func GetParentBranch(branchName string) string

GetParentBranch returns the name of the parent branch of the given branch.

func GetPerennialBranches

func GetPerennialBranches() []string

GetPerennialBranches returns all branches that are marked as perennial.

func GetPreviouslyCheckedOutBranch

func GetPreviouslyCheckedOutBranch() string

GetPreviouslyCheckedOutBranch returns the name of the previously checked out branch

func GetPrintableBranchTree

func GetPrintableBranchTree(branchName string) (result string)

GetPrintableBranchTree returns a user printable branch tree

func GetPrintableHackPushFlag

func GetPrintableHackPushFlag() string

GetPrintableHackPushFlag returns a user printable hack push flag

func GetPrintableMainBranch

func GetPrintableMainBranch() string

GetPrintableMainBranch returns a user printable main branch

func GetPrintablePerennialBranches

func GetPrintablePerennialBranches() string

GetPrintablePerennialBranches returns a user printable list of perennial branches

func GetPullBranchStrategy

func GetPullBranchStrategy() string

GetPullBranchStrategy returns the currently configured pull branch strategy.

func GetRemoteOriginURL

func GetRemoteOriginURL() string

GetRemoteOriginURL returns the URL for the "origin" remote. In tests this value can be stubbed.

func GetRemoteUpstreamURL

func GetRemoteUpstreamURL() string

GetRemoteUpstreamURL returns the URL of the "upstream" remote.

func GetRootDirectory

func GetRootDirectory() string

GetRootDirectory returns the path of the rood directory of the current repository, i.e. the directory that contains the ".git" folder.

func GetTrackingBranchName

func GetTrackingBranchName(branchName string) string

GetTrackingBranchName returns the name of the remote branch that corresponds to the local branch with the given name

func GetURLHostname

func GetURLHostname(url string) string

GetURLHostname returns the hostname contained within the given Git URL.

func GetURLRepositoryName

func GetURLRepositoryName(url string) string

GetURLRepositoryName returns the repository name contains within the given Git URL.

func HasBranch

func HasBranch(branchName string) bool

HasBranch returns whether the repository contains a branch with the given name. The branch does not have to be present on the local repository.

func HasCompiledAncestorBranches

func HasCompiledAncestorBranches(branchName string) bool

HasCompiledAncestorBranches returns whether the Git Town configuration contains a cached ancestor list for the branch with the given name.

func HasConflicts

func HasConflicts() bool

HasConflicts returns whether the local repository currently has unresolved merge conflicts.

func HasGlobalConfigurationValue

func HasGlobalConfigurationValue(key string) bool

HasGlobalConfigurationValue returns whether there is a global git configuration for the given key

func HasLocalBranch

func HasLocalBranch(branchName string) bool

HasLocalBranch returns whether the local repository contains a branch with the given name.

func HasOpenChanges

func HasOpenChanges() bool

HasOpenChanges returns whether the local repository contains uncommitted changes.

func HasRemote

func HasRemote(name string) bool

HasRemote returns whether the current repository contains a Git remote with the given name.

func HasShippableChanges

func HasShippableChanges(branchName string) bool

HasShippableChanges returns whether the supplied branch has an changes not currently on the main branchName

func HasTrackingBranch

func HasTrackingBranch(branchName string) bool

HasTrackingBranch returns whether the local branch with the given name has a tracking branch.

func IsAncestorBranch

func IsAncestorBranch(branchName, ancestorBranchName string) bool

IsAncestorBranch returns whether the given branch is an ancestor of the other given branch.

func IsBranchInSync

func IsBranchInSync(branchName string) bool

IsBranchInSync returns whether the branch with the given name is in sync with its tracking branch

func IsFeatureBranch

func IsFeatureBranch(branchName string) bool

IsFeatureBranch returns whether the branch with the given name is a feature branch.

func IsMainBranch

func IsMainBranch(branchName string) bool

IsMainBranch returns whether the branch with the given name is the main branch of the repository.

func IsMergeInProgress

func IsMergeInProgress() bool

IsMergeInProgress returns whether the local repository is in the middle of an unfinished merge process.

func IsPerennialBranch

func IsPerennialBranch(branchName string) bool

IsPerennialBranch returns whether the branch with the given name is a perennial branch.

func IsRebaseInProgress

func IsRebaseInProgress() bool

IsRebaseInProgress returns whether the local repository is in the middle of an unfinished rebase process.

func IsRepository

func IsRepository() bool

IsRepository returns whether or not the current directory is in a repository

func RemoveAllConfiguration

func RemoveAllConfiguration()

RemoveAllConfiguration removes all Git Town configuration

func RemoveFromPerennialBranches

func RemoveFromPerennialBranches(branchName string)

RemoveFromPerennialBranches removes the given branch as a perennial branch

func SetAncestorBranches

func SetAncestorBranches(branchName string, ancestorBranches []string)

SetAncestorBranches stores the given list of branches as ancestors for the given branch in the Git Town configuration.

func SetMainBranch

func SetMainBranch(branchName string)

SetMainBranch marks the given branch as the main branch in the Git Town configuration.

func SetParentBranch

func SetParentBranch(branchName, parentBranchName string)

SetParentBranch marks the given branch as the direct parent of the other given branch in the Git Town configuration.

func SetPerennialBranches

func SetPerennialBranches(branchNames []string)

SetPerennialBranches marks the given branches as perennial branches

func SetPullBranchStrategy

func SetPullBranchStrategy(strategy string)

SetPullBranchStrategy updates the configured pull branch strategy.

func ShouldBranchBePushed

func ShouldBranchBePushed(branchName string) bool

ShouldBranchBePushed returns whether the local branch with the given name contains commits that have not been pushed to the remote.

func ShouldHackPush

func ShouldHackPush() bool

ShouldHackPush returns whether the current repository is configured to push freshly created branches up to the origin remote.

func UpdateShouldHackPush

func UpdateShouldHackPush(value bool)

UpdateShouldHackPush updates whether the current repository is configured to push freshly created branches up to the origin remote.

Types

This section is empty.

Jump to

Keyboard shortcuts

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