Documentation
¶
Index ¶
- func AddToPerennialBranches(branchName string)
- func CommentOutSquashCommitMessage(prefix string)
- func CompileAncestorBranches(branchName string) (result []string)
- func DeleteAllAncestorBranches()
- func DeleteParentBranch(branchName string)
- func DoesBranchHaveUnmergedCommits(branchName string) bool
- func EnsureBranchInSync(branchName, errorMessageSuffix string)
- func EnsureDoesNotHaveBranch(branchName string)
- func EnsureDoesNotHaveConflicts()
- func EnsureDoesNotHaveOpenChanges(message string)
- func EnsureHasBranch(branchName string)
- func EnsureIsFeatureBranch(branchName, errorSuffix string)
- func EnsureIsNotMainBranch(branchName, errorMessage string)
- func EnsureIsNotPerennialBranch(branchName, errorMessage string)
- func EnsureIsPerennialBranch(branchName, errorMessage string)
- func EnsureVersionRequirementSatisfied()
- func GetAncestorBranches(branchName string) []string
- func GetBranchSha(branchName string) string
- func GetChildBranches(branchName string) (result []string)
- func GetConfigurationValue(key string) (result string)
- func GetCurrentBranchName() string
- func GetCurrentSha() string
- func GetExpectedPreviouslyCheckedOutBranch(initialPreviouslyCheckedOutBranch, initialBranch string) string
- func GetGlobalConfigurationValue(key string) (result string)
- func GetLastCommitMessage() string
- func GetLocalAuthor() string
- func GetLocalBranches() (result []string)
- func GetLocalBranchesWithDeletedTrackingBranches() (result []string)
- func GetLocalBranchesWithMainBranchFirst() (result []string)
- func GetMainBranch() string
- func GetParentBranch(branchName string) string
- func GetPerennialBranches() []string
- func GetPreviouslyCheckedOutBranch() string
- func GetPrintableBranchTree(branchName string) (result string)
- func GetPrintableHackPushFlag() string
- func GetPrintableMainBranch() string
- func GetPrintableOfflineFlag() string
- func GetPrintablePerennialBranches() string
- func GetPullBranchStrategy() string
- func GetRemoteOriginURL() string
- func GetRemoteUpstreamURL() string
- func GetRootDirectory() string
- func GetTrackingBranchName(branchName string) string
- func GetURLHostname(url string) string
- func GetURLRepositoryName(url string) string
- func HasBranch(branchName string) bool
- func HasCompiledAncestorBranches(branchName string) bool
- func HasConflicts() bool
- func HasGlobalConfigurationValue(key string) bool
- func HasLocalBranch(branchName string) bool
- func HasOpenChanges() bool
- func HasRemote(name string) bool
- func HasShippableChanges(branchName string) bool
- func HasTrackingBranch(branchName string) bool
- func IsAncestorBranch(branchName, ancestorBranchName string) bool
- func IsBranchInSync(branchName string) bool
- func IsFeatureBranch(branchName string) bool
- func IsMainBranch(branchName string) bool
- func IsMergeInProgress() bool
- func IsOffline() bool
- func IsPerennialBranch(branchName string) bool
- func IsRebaseInProgress() bool
- func IsRepository() bool
- func RemoveAllConfiguration()
- func RemoveFromPerennialBranches(branchName string)
- func SetAncestorBranches(branchName string, ancestorBranches []string)
- func SetMainBranch(branchName string)
- func SetParentBranch(branchName, parentBranchName string)
- func SetPerennialBranches(branchNames []string)
- func SetPullBranchStrategy(strategy string)
- func ShouldBranchBePushed(branchName string) bool
- func ShouldHackPush() bool
- func UpdateOffline(value bool)
- func UpdateShouldHackPush(value bool)
- func ValidateIsOnline() error
- func ValidateIsRepository() error
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 CommentOutSquashCommitMessage ¶
func CommentOutSquashCommitMessage(prefix string)
CommentOutSquashCommitMessage comments out the message for the current squash merge Adds the given prefix with the newline if provided
func CompileAncestorBranches ¶
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 ¶
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 EnsureVersionRequirementSatisfied ¶
func EnsureVersionRequirementSatisfied()
EnsureVersionRequirementSatisfied asserts that Git is the needed version or higher
func GetAncestorBranches ¶
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 ¶
GetBranchSha returns the SHA1 of the latest commit on the branch with the given name.
func GetChildBranches ¶
GetChildBranches returns the names of all branches for which the given branch is a parent.
func GetConfigurationValue ¶
GetConfigurationValue returns the given configuration value, from either global or local Git configuration
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 ¶
GetGlobalConfigurationValue returns the global git configuration value for the given key
func GetLastCommitMessage ¶
func GetLastCommitMessage() string
GetLastCommitMessage returns the commit message for the last commit
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 GetParentBranch ¶
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 ¶
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 GetPrintableOfflineFlag ¶
func GetPrintableOfflineFlag() string
GetPrintableOfflineFlag returns a user printable offline flag
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 ¶
GetTrackingBranchName returns the name of the remote branch that corresponds to the local branch with the given name
func GetURLHostname ¶
GetURLHostname returns the hostname contained within the given Git URL.
func GetURLRepositoryName ¶
GetURLRepositoryName returns the repository name contains within the given Git URL.
func HasBranch ¶
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 ¶
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 ¶
HasGlobalConfigurationValue returns whether there is a global git configuration for the given key
func HasLocalBranch ¶
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 ¶
HasRemote returns whether the current repository contains a Git remote with the given name.
func HasShippableChanges ¶
HasShippableChanges returns whether the supplied branch has an changes not currently on the main branchName
func HasTrackingBranch ¶
HasTrackingBranch returns whether the local branch with the given name has a tracking branch.
func IsAncestorBranch ¶
IsAncestorBranch returns whether the given branch is an ancestor of the other given branch.
func IsBranchInSync ¶
IsBranchInSync returns whether the branch with the given name is in sync with its tracking branch
func IsFeatureBranch ¶
IsFeatureBranch returns whether the branch with the given name is a feature branch.
func IsMainBranch ¶
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 IsOffline ¶
func IsOffline() bool
IsOffline returns whether Git Town is currently in offline mode
func IsPerennialBranch ¶
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 ¶
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 ¶
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 UpdateOffline ¶
func UpdateOffline(value bool)
UpdateOffline updates whether Git Town is in offline mode
func UpdateShouldHackPush ¶
func UpdateShouldHackPush(value bool)
UpdateShouldHackPush updates whether the current repository is configured to push freshly created branches up to the origin remote.
func ValidateIsOnline ¶
func ValidateIsOnline() error
ValidateIsOnline asserts that Git Town is not in offline mode
func ValidateIsRepository ¶
func ValidateIsRepository() error
ValidateIsRepository asserts that the current directory is in a repository
Types ¶
This section is empty.