Documentation ¶
Overview ¶
Package configdomain defines domain concepts and data types around Git Town configuration. These types exist in their own package because they are used in various places.
Index ¶
- Constants
- type AliasableCommand
- type AliasableCommands
- type Aliases
- type BranchType
- type FullConfig
- func (self *FullConfig) BranchType(branch gitdomain.LocalBranchName) BranchType
- func (self *FullConfig) ContainsLineage() bool
- func (self *FullConfig) IsContributionBranch(branch gitdomain.LocalBranchName) bool
- func (self *FullConfig) IsMainBranch(branch gitdomain.LocalBranchName) bool
- func (self *FullConfig) IsMainOrPerennialBranch(branch gitdomain.LocalBranchName) bool
- func (self *FullConfig) IsObservedBranch(branch gitdomain.LocalBranchName) bool
- func (self *FullConfig) IsOnline() bool
- func (self *FullConfig) IsParkedBranch(branch gitdomain.LocalBranchName) bool
- func (self *FullConfig) IsPerennialBranch(branch gitdomain.LocalBranchName) bool
- func (self *FullConfig) MainAndPerennials() gitdomain.LocalBranchNames
- func (self *FullConfig) Merge(other PartialConfig)
- func (self *FullConfig) NoPushHook() NoPushHook
- func (self *FullConfig) Online() Online
- func (self *FullConfig) ShouldPushNewBranches() bool
- type GitHubToken
- type GitLabToken
- type GiteaToken
- type HostingOriginHostname
- type HostingPlatform
- type Lineage
- func (self Lineage) Ancestors(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
- func (self Lineage) AncestorsWithoutRoot(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
- func (self Lineage) BranchAndAncestors(branchName gitdomain.LocalBranchName) gitdomain.LocalBranchNames
- func (self Lineage) BranchLineageWithoutRoot(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
- func (self Lineage) BranchNames() gitdomain.LocalBranchNames
- func (self Lineage) BranchesAndAncestors(branchNames gitdomain.LocalBranchNames) gitdomain.LocalBranchNames
- func (self Lineage) Children(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
- func (self Lineage) Descendants(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
- func (self Lineage) HasParents(branch gitdomain.LocalBranchName) bool
- func (self Lineage) IsAncestor(ancestor, other gitdomain.LocalBranchName) bool
- func (self Lineage) OrderHierarchically(branches gitdomain.LocalBranchNames) gitdomain.LocalBranchNames
- func (self Lineage) Parent(branch gitdomain.LocalBranchName) gitdomain.LocalBranchName
- func (self Lineage) RemoveBranch(branch gitdomain.LocalBranchName)
- func (self Lineage) Roots() gitdomain.LocalBranchNames
- type NoPushHook
- type Offline
- type Online
- type OriginURLCache
- type PartialConfig
- type PerennialRegex
- type PushHook
- type PushNewBranches
- type ShipDeleteTrackingBranch
- func NewShipDeleteTrackingBranch(value bool) ShipDeleteTrackingBranch
- func NewShipDeleteTrackingBranchRef(value bool) *ShipDeleteTrackingBranch
- func ParseShipDeleteTrackingBranch(value, source string) (ShipDeleteTrackingBranch, error)
- func ParseShipDeleteTrackingBranchRef(value, source string) (*ShipDeleteTrackingBranch, error)
- type SyncBeforeShip
- type SyncFeatureStrategy
- type SyncPerennialStrategy
- type SyncUpstream
Constants ¶
const ( AliasableCommandAppend = AliasableCommand("append") AliasableCommandCompress = AliasableCommand("compress") AliasableCommandContribute = AliasableCommand("contribute") AliasableCommandDiffParent = AliasableCommand("diff-parent") AliasableCommandHack = AliasableCommand("hack") AliasableCommandKill = AliasableCommand("kill") AliasableCommandObserve = AliasableCommand("observe") AliasableCommandPark = AliasableCommand("park") AliasableCommandPrepend = AliasableCommand("prepend") AliasableCommandPropose = AliasableCommand("propose") AliasableCommandRenameBranch = AliasableCommand("rename-branch") AliasableCommandRepo = AliasableCommand("repo") AliasableCommandSetParent = AliasableCommand("set-parent") AliasableCommandShip = AliasableCommand("ship") AliasableCommandSync = AliasableCommand("sync") )
const ( HostingPlatformBitbucket = HostingPlatform("bitbucket") HostingPlatformGitHub = HostingPlatform("github") HostingPlatformGitLab = HostingPlatform("gitlab") HostingPlatformGitea = HostingPlatform("gitea") HostingPlatformNone = HostingPlatform("") // no hosting or auto-detect )
const ( SyncFeatureStrategyMerge = SyncFeatureStrategy("merge") SyncFeatureStrategyRebase = SyncFeatureStrategy("rebase") )
const ( SyncPerennialStrategyMerge = SyncPerennialStrategy("merge") SyncPerennialStrategyRebase = SyncPerennialStrategy("rebase") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliasableCommand ¶
type AliasableCommand string
AliasableCommand defines Git Town commands that can shortened via Git aliases.
func (AliasableCommand) String ¶
func (self AliasableCommand) String() string
type AliasableCommands ¶
type AliasableCommands []AliasableCommand
func AllAliasableCommands ¶
func AllAliasableCommands() AliasableCommands
AllAliasableCommands provides all AliasType values.
func (AliasableCommands) Strings ¶
func (self AliasableCommands) Strings() []string
type Aliases ¶
type Aliases map[AliasableCommand]string
Aliases contains the Git Town releated Git aliases.
type BranchType ¶
type BranchType int
const ( BranchTypeMainBranch BranchType = iota BranchTypePerennialBranch BranchTypeFeatureBranch BranchTypeParkedBranch BranchTypeContributionBranch BranchTypeObservedBranch )
func NewBranchType ¶
func NewBranchType(name string) BranchType
func (BranchType) ShouldPush ¶
func (self BranchType) ShouldPush(currentBranch, initialBranch gitdomain.LocalBranchName) bool
ShouldPush indicates whether a branch with this type should push its local commit to origin.
func (BranchType) String ¶
func (self BranchType) String() string
type FullConfig ¶
type FullConfig struct { Aliases Aliases ContributionBranches gitdomain.LocalBranchNames GitHubToken GitHubToken GitLabToken GitLabToken GitUserEmail string GitUserName string GiteaToken GiteaToken HostingOriginHostname HostingOriginHostname HostingPlatform HostingPlatform Lineage Lineage MainBranch gitdomain.LocalBranchName ObservedBranches gitdomain.LocalBranchNames Offline Offline ParkedBranches gitdomain.LocalBranchNames PerennialBranches gitdomain.LocalBranchNames PerennialRegex PerennialRegex PushHook PushHook PushNewBranches PushNewBranches ShipDeleteTrackingBranch ShipDeleteTrackingBranch SyncBeforeShip SyncBeforeShip SyncFeatureStrategy SyncFeatureStrategy SyncPerennialStrategy SyncPerennialStrategy SyncUpstream SyncUpstream }
FullConfig is the merged configuration to be used by Git Town commands.
func DefaultConfig ¶
func DefaultConfig() FullConfig
DefaultConfig provides the default configuration data to use when nothing is configured.
func NewFullConfig ¶ added in v14.1.0
func NewFullConfig(configFile *PartialConfig, globalGitConfig, localGitConfig PartialConfig) FullConfig
func (*FullConfig) BranchType ¶
func (self *FullConfig) BranchType(branch gitdomain.LocalBranchName) BranchType
func (*FullConfig) ContainsLineage ¶
func (self *FullConfig) ContainsLineage() bool
ContainsLineage indicates whether this configuration contains any lineage entries.
func (*FullConfig) IsContributionBranch ¶
func (self *FullConfig) IsContributionBranch(branch gitdomain.LocalBranchName) bool
func (*FullConfig) IsMainBranch ¶
func (self *FullConfig) IsMainBranch(branch gitdomain.LocalBranchName) bool
IsMainBranch indicates whether the branch with the given name is the main branch of the repository.
func (*FullConfig) IsMainOrPerennialBranch ¶
func (self *FullConfig) IsMainOrPerennialBranch(branch gitdomain.LocalBranchName) bool
IsMainOrPerennialBranch indicates whether the branch with the given name is the main branch or a perennial branch of the repository.
func (*FullConfig) IsObservedBranch ¶
func (self *FullConfig) IsObservedBranch(branch gitdomain.LocalBranchName) bool
func (*FullConfig) IsOnline ¶
func (self *FullConfig) IsOnline() bool
func (*FullConfig) IsParkedBranch ¶
func (self *FullConfig) IsParkedBranch(branch gitdomain.LocalBranchName) bool
func (*FullConfig) IsPerennialBranch ¶
func (self *FullConfig) IsPerennialBranch(branch gitdomain.LocalBranchName) bool
func (*FullConfig) MainAndPerennials ¶
func (self *FullConfig) MainAndPerennials() gitdomain.LocalBranchNames
func (*FullConfig) Merge ¶
func (self *FullConfig) Merge(other PartialConfig)
Merges the given PartialConfig into this configuration object.
func (*FullConfig) NoPushHook ¶
func (self *FullConfig) NoPushHook() NoPushHook
func (*FullConfig) Online ¶
func (self *FullConfig) Online() Online
func (*FullConfig) ShouldPushNewBranches ¶
func (self *FullConfig) ShouldPushNewBranches() bool
type GitHubToken ¶
type GitHubToken string
GitHubToken is a bearer token to use with the GitHub API.
func NewGitHubTokenRef ¶
func NewGitHubTokenRef(value string) *GitHubToken
func (GitHubToken) String ¶
func (self GitHubToken) String() string
type GitLabToken ¶
type GitLabToken string
GitLabToken is a bearer token to use with the GitLab API.
func NewGitLabTokenRef ¶
func NewGitLabTokenRef(value string) *GitLabToken
func (GitLabToken) String ¶
func (self GitLabToken) String() string
type GiteaToken ¶
type GiteaToken string
GiteaToken is a bearer token to use with the Gitea API.
func NewGiteaTokenRef ¶
func NewGiteaTokenRef(value string) *GiteaToken
func (GiteaToken) String ¶
func (self GiteaToken) String() string
type HostingOriginHostname ¶
type HostingOriginHostname string
func NewHostingOriginHostnameRef ¶
func NewHostingOriginHostnameRef(value string) *HostingOriginHostname
func (HostingOriginHostname) String ¶
func (self HostingOriginHostname) String() string
type HostingPlatform ¶
type HostingPlatform string
HostingPlatform defines legal values for the "git-town.hosting-platform" config setting.
func NewHostingPlatform ¶
func NewHostingPlatform(platformName string) (HostingPlatform, error)
NewHostingPlatform provides the HostingPlatform enum matching the given text.
func NewHostingPlatformRef ¶
func NewHostingPlatformRef(platformName string) (*HostingPlatform, error)
NewHostingPlatformRef provides the HostingPlatform enum matching the given text.
func (HostingPlatform) String ¶
func (self HostingPlatform) String() string
type Lineage ¶
type Lineage map[gitdomain.LocalBranchName]gitdomain.LocalBranchName
Lineage encapsulates all data and functionality around parent branches. branch --> its parent Lineage only contains branches that have ancestors.
func (Lineage) Ancestors ¶
func (self Lineage) Ancestors(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
Ancestors provides the names of all parent branches of the branch with the given name.
func (Lineage) AncestorsWithoutRoot ¶
func (self Lineage) AncestorsWithoutRoot(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
AncestorsWithoutRoot provides the names of all parent branches of the branch with the given name, excluding the root perennial branch.
func (Lineage) BranchAndAncestors ¶
func (self Lineage) BranchAndAncestors(branchName gitdomain.LocalBranchName) gitdomain.LocalBranchNames
BranchAndAncestors provides the full ancestry for the branch with the given name, including the branch.
func (Lineage) BranchLineageWithoutRoot ¶
func (self Lineage) BranchLineageWithoutRoot(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
BranchLineageWithoutRoot provides all branches in the lineage of the given branch, from oldest to youngest, including the given branch.
func (Lineage) BranchNames ¶
func (self Lineage) BranchNames() gitdomain.LocalBranchNames
BranchNames provides the names of all branches in this Lineage, sorted alphabetically.
func (Lineage) BranchesAndAncestors ¶
func (self Lineage) BranchesAndAncestors(branchNames gitdomain.LocalBranchNames) gitdomain.LocalBranchNames
BranchesAndAncestors provides the full lineage for the branches with the given names, including the branches themselves.
func (Lineage) Children ¶
func (self Lineage) Children(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
Children provides the names of all branches that have the given branch as their parent.
func (Lineage) Descendants ¶
func (self Lineage) Descendants(branch gitdomain.LocalBranchName) gitdomain.LocalBranchNames
Descendants provides all branches that depend on the given branch in its lineage.
func (Lineage) HasParents ¶
func (self Lineage) HasParents(branch gitdomain.LocalBranchName) bool
HasParents returns whether or not the given branch has at least one parent.
func (Lineage) IsAncestor ¶
func (self Lineage) IsAncestor(ancestor, other gitdomain.LocalBranchName) bool
IsAncestor indicates whether the given branch is an ancestor of the other given branch.
func (Lineage) OrderHierarchically ¶
func (self Lineage) OrderHierarchically(branches gitdomain.LocalBranchNames) gitdomain.LocalBranchNames
OrderHierarchically provides the given branches sorted so that ancestor branches come before their descendants.
func (Lineage) Parent ¶
func (self Lineage) Parent(branch gitdomain.LocalBranchName) gitdomain.LocalBranchName
Parent provides the name of the parent branch for the given branch or nil if the branch has no parent.
func (Lineage) RemoveBranch ¶
func (self Lineage) RemoveBranch(branch gitdomain.LocalBranchName)
RemoveBranch removes the given branch completely from this lineage.
func (Lineage) Roots ¶
func (self Lineage) Roots() gitdomain.LocalBranchNames
Roots provides the branches with children and no parents.
type NoPushHook ¶
type NoPushHook bool
NoPushHook helps using the type checker to verify correct negation of the push-hook configuration setting.
func (NoPushHook) Bool ¶
func (noPushHook NoPushHook) Bool() bool
type Offline ¶
type Offline bool
Offline is a new-type for the "offline" configuration setting.
func NewOfflineRef ¶
type OriginURLCache ¶
type PartialConfig ¶
type PartialConfig struct { Aliases Aliases ContributionBranches *gitdomain.LocalBranchNames GitHubToken *GitHubToken GitLabToken *GitLabToken GitUserEmail *string GitUserName *string GiteaToken *GiteaToken HostingOriginHostname *HostingOriginHostname HostingPlatform *HostingPlatform Lineage *Lineage MainBranch *gitdomain.LocalBranchName ObservedBranches *gitdomain.LocalBranchNames Offline *Offline ParkedBranches *gitdomain.LocalBranchNames PerennialBranches *gitdomain.LocalBranchNames PerennialRegex *PerennialRegex PushHook *PushHook PushNewBranches *PushNewBranches ShipDeleteTrackingBranch *ShipDeleteTrackingBranch SyncBeforeShip *SyncBeforeShip SyncFeatureStrategy *SyncFeatureStrategy SyncPerennialStrategy *SyncPerennialStrategy SyncUpstream *SyncUpstream }
PartialConfig contains configuration data as it is stored in the local or global Git configuration.
func EmptyPartialConfig ¶
func EmptyPartialConfig() PartialConfig
type PerennialRegex ¶
type PerennialRegex string
PerennialRegex contains the "branches.perennial-regex" setting.
func NewPerennialRegexRef ¶
func NewPerennialRegexRef(value string) *PerennialRegex
func (PerennialRegex) MatchesBranch ¶
func (self PerennialRegex) MatchesBranch(branch gitdomain.LocalBranchName) bool
MatchesBranch indicates whether the given branch matches this PerennialRegex.
func (PerennialRegex) String ¶
func (self PerennialRegex) String() string
type PushHook ¶
type PushHook bool
PushHook contains the push-hook configuration setting.
func NewPushHook ¶
func NewPushHookRef ¶
func (PushHook) Negate ¶
func (pushHook PushHook) Negate() NoPushHook
type PushNewBranches ¶
type PushNewBranches bool
PushNewBranches indicates whether newly created branches should be pushed to the remote or not.
func NewPushNewBranchesRef ¶
func NewPushNewBranchesRef(value bool) *PushNewBranches
func ParsePushNewBranches ¶
func ParsePushNewBranches(value, source string) (PushNewBranches, error)
func ParsePushNewBranchesRef ¶
func ParsePushNewBranchesRef(value, source string) (*PushNewBranches, error)
func (PushNewBranches) Bool ¶
func (self PushNewBranches) Bool() bool
func (PushNewBranches) String ¶
func (self PushNewBranches) String() string
type ShipDeleteTrackingBranch ¶
type ShipDeleteTrackingBranch bool
ShipDeleteTrackingBranch contains the configuration setting about whether to delete the tracking branch when shipping.
func NewShipDeleteTrackingBranch ¶
func NewShipDeleteTrackingBranch(value bool) ShipDeleteTrackingBranch
func NewShipDeleteTrackingBranchRef ¶
func NewShipDeleteTrackingBranchRef(value bool) *ShipDeleteTrackingBranch
func ParseShipDeleteTrackingBranch ¶
func ParseShipDeleteTrackingBranch(value, source string) (ShipDeleteTrackingBranch, error)
func ParseShipDeleteTrackingBranchRef ¶
func ParseShipDeleteTrackingBranchRef(value, source string) (*ShipDeleteTrackingBranch, error)
func (ShipDeleteTrackingBranch) Bool ¶
func (self ShipDeleteTrackingBranch) Bool() bool
func (ShipDeleteTrackingBranch) String ¶
func (self ShipDeleteTrackingBranch) String() string
type SyncBeforeShip ¶
type SyncBeforeShip bool
func NewSyncBeforeShip ¶
func NewSyncBeforeShip(value bool) SyncBeforeShip
func NewSyncBeforeShipRef ¶
func NewSyncBeforeShipRef(value bool) *SyncBeforeShip
func ParseSyncBeforeShip ¶
func ParseSyncBeforeShip(value, source string) (SyncBeforeShip, error)
func ParseSyncBeforeShipRef ¶
func ParseSyncBeforeShipRef(value, source string) (*SyncBeforeShip, error)
func (SyncBeforeShip) Bool ¶
func (self SyncBeforeShip) Bool() bool
func (SyncBeforeShip) String ¶
func (self SyncBeforeShip) String() string
type SyncFeatureStrategy ¶
type SyncFeatureStrategy string
SyncFeatureStrategy defines legal values for the "sync-feature-strategy" configuration setting.
func NewSyncFeatureStrategy ¶
func NewSyncFeatureStrategy(text string) (SyncFeatureStrategy, error)
func NewSyncFeatureStrategyRef ¶
func NewSyncFeatureStrategyRef(text string) (*SyncFeatureStrategy, error)
func (SyncFeatureStrategy) String ¶
func (self SyncFeatureStrategy) String() string
func (SyncFeatureStrategy) StringRef ¶
func (self SyncFeatureStrategy) StringRef() *string
type SyncPerennialStrategy ¶
type SyncPerennialStrategy string
SyncPerennialStrategy defines legal values for the "sync-perennial-strategy" configuration setting.
func NewSyncPerennialStrategy ¶
func NewSyncPerennialStrategy(text string) (SyncPerennialStrategy, error)
func NewSyncPerennialStrategyRef ¶
func NewSyncPerennialStrategyRef(text string) (*SyncPerennialStrategy, error)
func (SyncPerennialStrategy) String ¶
func (self SyncPerennialStrategy) String() string
func (SyncPerennialStrategy) StringRef ¶
func (self SyncPerennialStrategy) StringRef() *string
type SyncUpstream ¶
type SyncUpstream bool
SyncUpstream contains the configuration setting whether to sync with the upstream remote.
func NewSyncUpstreamRef ¶
func NewSyncUpstreamRef(value bool) *SyncUpstream
func ParseSyncUpstream ¶
func ParseSyncUpstream(value, source string) (SyncUpstream, error)
func ParseSyncUpstreamRef ¶
func ParseSyncUpstreamRef(value, source string) (*SyncUpstream, error)
func (SyncUpstream) Bool ¶
func (self SyncUpstream) Bool() bool
func (SyncUpstream) String ¶
func (self SyncUpstream) String() string
Source Files ¶
- aliasable_command.go
- aliases.go
- branch_type.go
- core.go
- full_config.go
- gitea_token.go
- github_token.go
- gitlab_token.go
- hosting_origin_hostname.go
- hosting_platform.go
- lineage.go
- offline.go
- origin_url_cache.go
- partial_config.go
- perennial_regex.go
- push_hook.go
- push_new_branches.go
- ship_delete_tracking_branch.go
- sync_before_ship.go
- sync_feature_strategy.go
- sync_perennial_strategy.go
- sync_upstream.go