configdomain

package
v15.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 16 Imported by: 0

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

View Source
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")
)
View Source
const (
	HostingPlatformBitbucket = HostingPlatform("bitbucket")
	HostingPlatformGitHub    = HostingPlatform("github")
	HostingPlatformGitLab    = HostingPlatform("gitlab")
	HostingPlatformGitea     = HostingPlatform("gitea")
)
View Source
const (
	KeyAliasAppend                         = Key("alias.append")
	KeyAliasCompress                       = Key("alias.compress")
	KeyAliasContribute                     = Key("alias.contribute")
	KeyAliasDiffParent                     = Key("alias.diff-parent")
	KeyAliasHack                           = Key("alias.hack")
	KeyAliasKill                           = Key("alias.kill")
	KeyAliasObserve                        = Key("alias.observe")
	KeyAliasPark                           = Key("alias.park")
	KeyAliasPrepend                        = Key("alias.prepend")
	KeyAliasPropose                        = Key("alias.propose")
	KeyAliasRenameBranch                   = Key("alias.rename-branch")
	KeyAliasRepo                           = Key("alias.repo")
	KeyAliasSetParent                      = Key("alias.set-parent")
	KeyAliasShip                           = Key("alias.ship")
	KeyAliasSync                           = Key("alias.sync")
	KeyContributionBranches                = Key("git-town.contribution-branches")
	KeyCreatePrototypeBranches             = Key("git-town.create-prototype-branches")
	KeyDeprecatedCodeHostingDriver         = Key("git-town.code-hosting-driver")
	KeyDeprecatedCodeHostingOriginHostname = Key("git-town.code-hosting-origin-hostname")
	KeyDeprecatedCodeHostingPlatform       = Key("git-town.code-hosting-platform")
	KeyDeprecatedMainBranchName            = Key("git-town.main-branch-name")
	KeyDeprecatedNewBranchPushFlag         = Key("git-town.new-branch-push-flag")
	KeyDeprecatedPerennialBranchNames      = Key("git-town.perennial-branch-names")
	KeyDeprecatedPullBranchStrategy        = Key("git-town.pull-branch-strategy")
	KeyDeprecatedPushVerify                = Key("git-town.push-verify")
	KeyDeprecatedShipDeleteRemoteBranch    = Key("git-town.ship-delete-remote-branch")
	KeyDeprecatedSyncStrategy              = Key("git-town.sync-strategy")
	KeyGiteaToken                          = Key("git-town.gitea-token")
	KeyGithubToken                         = Key(pkg.KeyGithubToken)
	KeyGitlabToken                         = Key("git-town.gitlab-token")
	KeyHostingOriginHostname               = Key("git-town.hosting-origin-hostname")
	KeyHostingPlatform                     = Key("git-town.hosting-platform")
	KeyMainBranch                          = Key("git-town.main-branch")
	KeyObservedBranches                    = Key("git-town.observed-branches")
	KeyOffline                             = Key("git-town.offline")
	KeyParkedBranches                      = Key("git-town.parked-branches")
	KeyPerennialBranches                   = Key("git-town.perennial-branches")
	KeyPerennialRegex                      = Key("git-town.perennial-regex")
	KeyPrototypeBranches                   = Key("git-town.prototype-branches")
	KeyPushHook                            = Key("git-town.push-hook")
	KeyPushNewBranches                     = Key("git-town.push-new-branches")
	KeyShipDeleteTrackingBranch            = Key("git-town.ship-delete-tracking-branch")
	KeyObsoleteSyncBeforeShip              = Key("git-town.sync-before-ship")
	KeySyncFeatureStrategy                 = Key("git-town.sync-feature-strategy")
	KeySyncPerennialStrategy               = Key("git-town.sync-perennial-strategy")
	KeySyncPrototypeStrategy               = Key("git-town.sync-prototype-strategy")
	KeySyncStrategy                        = Key("git-town.sync-strategy")
	KeySyncTags                            = Key("git-town.sync-tags")
	KeySyncUpstream                        = Key("git-town.sync-upstream")
	KeyGitUserEmail                        = Key("user.email")
	KeyGitUserName                         = Key("user.name")
)
View Source
const (
	LineageKeyPrefix = "git-town-branch."
	LineageKeySuffix = ".parent"
)
View Source
const (
	SyncFeatureStrategyMerge    = SyncFeatureStrategy(SyncStrategyMerge)
	SyncFeatureStrategyRebase   = SyncFeatureStrategy(SyncStrategyRebase)
	SyncFeatureStrategyCompress = SyncFeatureStrategy(SyncStrategyCompress)
)
View Source
const (
	SyncPerennialStrategyMerge  = SyncPerennialStrategy(SyncStrategyMerge)
	SyncPerennialStrategyRebase = SyncPerennialStrategy(SyncStrategyRebase)
)
View Source
const (
	SyncPrototypeStrategyMerge  = SyncPrototypeStrategy(SyncStrategyMerge)
	SyncPrototypeStrategyRebase = SyncPrototypeStrategy(SyncStrategyRebase)
)
View Source
const (
	SyncStrategyMerge    = SyncStrategy("merge")
	SyncStrategyRebase   = SyncStrategy("rebase")
	SyncStrategyCompress = SyncStrategy("compress")
)
View Source
const AliasKeyPrefix = "alias."

Variables

DeprecatedKeys defines the up-to-date counterparts to deprecated configuration settings.

View Source
var ObsoleteKeys = []Key{
	KeyObsoleteSyncBeforeShip,
}

ObsoleteKeys defines the keys that are sunset and should get deleted

Functions

func NewAliasKey

func NewAliasKey(key Key) Option[AliasKey]

tries to convert this Key into an AliasKey

func NewLineageKey

func NewLineageKey(key Key) Option[LineageKey]

CheckLineage indicates using the returned option whether this key is a lineage key.

func ParseBranchType

func ParseBranchType(name string) Option[BranchType]

func ParseCreatePrototypeBranches

func ParseCreatePrototypeBranches(value, source string) (Option[CreatePrototypeBranches], error)

deserializes the given Git configuration value into a CreatePrototypeBranches instance

func ParseGitHubToken

func ParseGitHubToken(value string) Option[GitHubToken]

func ParseGitLabToken

func ParseGitLabToken(value string) Option[GitLabToken]

func ParseGitUserEmail

func ParseGitUserEmail(value string) Option[GitUserEmail]

func ParseGitUserName

func ParseGitUserName(value string) Option[GitUserName]

func ParseGiteaToken

func ParseGiteaToken(value string) Option[GiteaToken]

func ParseHostingOriginHostname

func ParseHostingOriginHostname(value string) Option[HostingOriginHostname]

func ParseHostingPlatform

func ParseHostingPlatform(platformName string) (Option[HostingPlatform], error)

ParseHostingPlatform provides the HostingPlatform enum matching the given text.

func ParseKey

func ParseKey(name string) Option[Key]

func ParseOffline

func ParseOffline(value, source string) (Option[Offline], error)

func ParsePerennialRegex

func ParsePerennialRegex(value string) Option[PerennialRegex]

func ParsePushHook

func ParsePushHook(value, source string) (Option[PushHook], error)

func ParsePushNewBranches

func ParsePushNewBranches(value, source string) (Option[PushNewBranches], error)

func ParseShipDeleteTrackingBranch

func ParseShipDeleteTrackingBranch(value, source string) (Option[ShipDeleteTrackingBranch], error)

func ParseSyncFeatureStrategy

func ParseSyncFeatureStrategy(text string) (Option[SyncFeatureStrategy], error)

func ParseSyncPerennialStrategy

func ParseSyncPerennialStrategy(text string) (Option[SyncPerennialStrategy], error)

func ParseSyncPrototypeStrategy

func ParseSyncPrototypeStrategy(text string) (Option[SyncPrototypeStrategy], error)

func ParseSyncStrategy

func ParseSyncStrategy(text string) (Option[SyncStrategy], error)

func ParseSyncTags added in v15.1.0

func ParseSyncTags(value, source string) (Option[SyncTags], error)

func ParseSyncUpstream

func ParseSyncUpstream(value, source string) (Option[SyncUpstream], error)

Types

type AliasKey

type AliasKey Key

A key used for storing aliases in the Git configuration

func (AliasKey) AliasableCommand

func (self AliasKey) AliasableCommand() AliasableCommand

provides the AliasableCommand matching this AliasKey

func (AliasKey) Key

func (self AliasKey) Key() Key

provides the generic Key that this AliasKey represents

func (AliasKey) String

func (self AliasKey) String() string

type AliasableCommand

type AliasableCommand string

AliasableCommand defines Git Town commands that can shortened via Git aliases.

func (AliasableCommand) Key

func (self AliasableCommand) Key() AliasKey

provides the key that configures this aliasable command in the Git config

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) LookupKey

func (self AliasableCommands) LookupKey(name string) Option[AliasKey]

provides the AliasKey matching the given key name

func (AliasableCommands) Strings

func (self AliasableCommands) Strings() []string

type Aliases

type Aliases map[AliasableCommand]string

Aliases contains the Git Town releated Git aliases.

type BranchToSync added in v15.2.0

type BranchToSync struct {
	BranchInfo         gitdomain.BranchInfo
	FirstCommitMessage Option[gitdomain.CommitMessage] // commit message of the first commit on this branch
}

all the information needed to sync a branch

type BranchType

type BranchType int
const (
	BranchTypeMainBranch BranchType = iota
	BranchTypePerennialBranch
	BranchTypeFeatureBranch
	BranchTypeParkedBranch
	BranchTypeContributionBranch
	BranchTypeObservedBranch
	BranchTypePrototypeBranch
)

func (BranchType) ShouldPush

func (self BranchType) ShouldPush(isInitialBranch bool) 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 ConfigScope

type ConfigScope int

defines the type of Git configuration used

const (
	// the global Git configuration
	ConfigScopeGlobal ConfigScope = iota

	// the local Git configuration
	ConfigScopeLocal
)

type CreatePrototypeBranches

type CreatePrototypeBranches bool

whether all created branches should be prototype

func (CreatePrototypeBranches) IsTrue

func (self CreatePrototypeBranches) IsTrue() bool

func (CreatePrototypeBranches) String

func (self CreatePrototypeBranches) String() string

type DryRun

type DryRun bool

indicates whether a Git Town command should execute the commands or only display them

func (DryRun) IsFalse

func (self DryRun) IsFalse() bool

func (DryRun) IsTrue

func (self DryRun) IsTrue() bool

type Force

type Force bool

indicates whether a Git Town command should execute the commands despite not all safety conditions in place

func (Force) IsFalse

func (self Force) IsFalse() bool

type FullStack added in v15.1.0

type FullStack bool

indicates whether to perform an activity on all branches in the current stack

func (FullStack) Enabled added in v15.1.0

func (self FullStack) Enabled() bool

type GitHubToken

type GitHubToken string

GitHubToken is a bearer token to use with the GitHub API.

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 (GitLabToken) String

func (self GitLabToken) String() string

type GitUserEmail

type GitUserEmail string

func (GitUserEmail) String

func (self GitUserEmail) String() string

type GitUserName

type GitUserName string

func (GitUserName) String

func (self GitUserName) String() string

type GiteaToken

type GiteaToken string

GiteaToken is a bearer token to use with the Gitea API.

func (GiteaToken) String

func (self GiteaToken) String() string

type HostingOriginHostname

type HostingOriginHostname string

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 (HostingPlatform) String

func (self HostingPlatform) String() string

type Key

type Key string

Key contains all the keys used in Git Town's Git metadata configuration.

func NewParentKey

func NewParentKey(branch gitdomain.LocalBranchName) Key

func (Key) MarshalJSON

func (self Key) MarshalJSON() ([]byte, error)

MarshalJSON is used when serializing this LocalBranchName to JSON.

func (Key) String

func (self Key) String() string

func (*Key) UnmarshalJSON

func (self *Key) UnmarshalJSON(b []byte) error

UnmarshalJSON is used when de-serializing JSON into a Location.

type Lineage

type Lineage struct {
	// contains filtered or unexported fields
}

Lineage encapsulates all data and functionality around parent branches. branch --> its parent Lineage only contains branches that have ancestors.

func NewLineage

func NewLineage() Lineage

func NewLineageFromSnapshot

func NewLineageFromSnapshot(snapshot SingleSnapshot, updateOutdated bool, removeLocalConfigValue removeLocalConfigValueFunc) (Lineage, error)

func (*Lineage) Add

func (self *Lineage) Add(branch, parent gitdomain.LocalBranchName)

func (Lineage) Ancestors

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) Branches

func (self Lineage) Branches() gitdomain.LocalBranchNames

provides all branches for which the parent is known

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

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) Entries

func (self Lineage) Entries() []LineageEntry

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) IsEmpty

func (self Lineage) IsEmpty() bool

func (Lineage) Len

func (self Lineage) Len() int

func (Lineage) Merge

func (self Lineage) Merge(other Lineage) Lineage

provides a new Lineage that consists of entries from both this and the given Lineage

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) Option[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 LineageEntry

type LineageEntry struct {
	Child  gitdomain.LocalBranchName
	Parent gitdomain.LocalBranchName
}

type LineageKey

type LineageKey Key

a Key that contains a lineage entry

func (LineageKey) ChildName

func (self LineageKey) ChildName() string

provides the name of the child branch encoded in this LineageKey

func (LineageKey) Key

func (self LineageKey) Key() Key

converts this LineageKey into a generic Key

func (LineageKey) String

func (self LineageKey) String() string

type NoPushHook

type NoPushHook bool

NoPushHook helps using the type checker to verify correct negation of the push-hook configuration setting.

type Offline

type Offline bool

Offline is a new-type for the "offline" configuration setting.

func (Offline) IsFalse added in v15.2.0

func (self Offline) IsFalse() bool

func (Offline) IsTrue added in v15.2.0

func (self Offline) IsTrue() bool

func (Offline) String

func (self Offline) String() string

func (Offline) ToOnline

func (self Offline) ToOnline() Online

type Online

type Online bool

func (Online) IsTrue added in v15.2.0

func (online Online) IsTrue() bool

type PartialConfig

type PartialConfig struct {
	Aliases                  Aliases
	ContributionBranches     gitdomain.LocalBranchNames
	CreatePrototypeBranches  Option[CreatePrototypeBranches]
	GitHubToken              Option[GitHubToken]
	GitLabToken              Option[GitLabToken]
	GitUserEmail             Option[GitUserEmail]
	GitUserName              Option[GitUserName]
	GiteaToken               Option[GiteaToken]
	HostingOriginHostname    Option[HostingOriginHostname]
	HostingPlatform          Option[HostingPlatform]
	Lineage                  Lineage
	MainBranch               Option[gitdomain.LocalBranchName]
	ObservedBranches         gitdomain.LocalBranchNames
	Offline                  Option[Offline]
	ParkedBranches           gitdomain.LocalBranchNames
	PerennialBranches        gitdomain.LocalBranchNames
	PerennialRegex           Option[PerennialRegex]
	PrototypeBranches        gitdomain.LocalBranchNames
	PushHook                 Option[PushHook]
	PushNewBranches          Option[PushNewBranches]
	ShipDeleteTrackingBranch Option[ShipDeleteTrackingBranch]
	SyncFeatureStrategy      Option[SyncFeatureStrategy]
	SyncPerennialStrategy    Option[SyncPerennialStrategy]
	SyncPrototypeStrategy    Option[SyncPrototypeStrategy]
	SyncTags                 Option[SyncTags]
	SyncUpstream             Option[SyncUpstream]
}

PartialConfig contains configuration data as it is stored in the local or global Git configuration.

func EmptyPartialConfig

func EmptyPartialConfig() PartialConfig

func NewPartialConfigFromSnapshot

func NewPartialConfigFromSnapshot(snapshot SingleSnapshot, updateOutdated bool, removeLocalConfigValue removeLocalConfigValueFunc) (PartialConfig, error)

func (PartialConfig) Merge

func (self PartialConfig) Merge(other PartialConfig) PartialConfig

Merges the given PartialConfig into this configuration object.

func (PartialConfig) ToUnvalidatedConfig

func (self PartialConfig) ToUnvalidatedConfig(defaults UnvalidatedConfig) UnvalidatedConfig

type Pending added in v15.3.0

type Pending bool

indicates whether "git town status" should print only the pending command

type PerennialRegex

type PerennialRegex string

PerennialRegex contains the "branches.perennial-regex" setting.

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 Prototype

type Prototype bool

indicates whether a Git Town command should create a prototype branch

func (Prototype) IsTrue

func (self Prototype) IsTrue() bool

type PushBranches

type PushBranches bool

indicates whether Git Town commands should push local commits to the respective tracking branch

func (PushBranches) IsTrue

func (self PushBranches) IsTrue() bool

type PushHook

type PushHook bool

PushHook contains the push-hook configuration setting.

func (PushHook) Negate

func (self PushHook) Negate() NoPushHook

func (PushHook) String

func (self PushHook) String() string

type PushNewBranches

type PushNewBranches bool

PushNewBranches indicates whether newly created branches should be pushed to the remote or not.

func (PushNewBranches) IsTrue added in v15.2.0

func (self PushNewBranches) IsTrue() 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 (ShipDeleteTrackingBranch) IsTrue added in v15.2.0

func (self ShipDeleteTrackingBranch) IsTrue() bool

func (ShipDeleteTrackingBranch) String

func (self ShipDeleteTrackingBranch) String() string

type ShipIntoNonperennialParent added in v15.1.0

type ShipIntoNonperennialParent bool

indicates whether to sync all branches or only the current branch

type SingleSnapshot

type SingleSnapshot map[Key]string

SingleSnapshot contains all of the local or global Git metadata config settings.

func (SingleSnapshot) AliasEntries

func (self SingleSnapshot) AliasEntries() map[AliasKey]string

provides all the keys that describe aliases for Git Town commands

func (SingleSnapshot) Aliases

func (self SingleSnapshot) Aliases() Aliases

func (SingleSnapshot) LineageEntries

func (self SingleSnapshot) LineageEntries() map[LineageKey]string

provides all the keys that describe lineage entries

type SwitchUsingMerge added in v15.1.0

type SwitchUsingMerge bool

indicates whether to switch to another branch using Git's --merge flag

func (SwitchUsingMerge) Enabled added in v15.1.0

func (self SwitchUsingMerge) Enabled() bool

type SyncAllBranches added in v15.1.0

type SyncAllBranches bool

indicates whether to sync all branches or only the current branch

func (SyncAllBranches) Enabled added in v15.1.0

func (self SyncAllBranches) Enabled() bool

type SyncFeatureStrategy

type SyncFeatureStrategy SyncStrategy

SyncFeatureStrategy defines legal values for the "sync-feature-strategy" configuration setting.

func (SyncFeatureStrategy) String

func (self SyncFeatureStrategy) String() string

func (SyncFeatureStrategy) SyncStrategy

func (self SyncFeatureStrategy) SyncStrategy() SyncStrategy

type SyncPerennialStrategy

type SyncPerennialStrategy SyncStrategy

SyncPerennialStrategy defines legal values for the "sync-perennial-strategy" configuration setting.

func (SyncPerennialStrategy) String

func (self SyncPerennialStrategy) String() string

func (SyncPerennialStrategy) SyncStrategy

func (self SyncPerennialStrategy) SyncStrategy() SyncStrategy

type SyncPrototypeStrategy

type SyncPrototypeStrategy SyncStrategy

SyncPrototypeStrategy defines legal values for the "sync-prototype-strategy" configuration setting.

func NewSyncPrototypeStrategyFromSyncFeatureStrategy

func NewSyncPrototypeStrategyFromSyncFeatureStrategy(syncFeatureStrategy SyncFeatureStrategy) SyncPrototypeStrategy

func (SyncPrototypeStrategy) String

func (self SyncPrototypeStrategy) String() string

func (SyncPrototypeStrategy) SyncStrategy

func (self SyncPrototypeStrategy) SyncStrategy() SyncStrategy

type SyncStrategy

type SyncStrategy string

SyncStrategy defines legal values for "sync-*-strategy" configuration settings.

func SyncStrategies added in v15.2.0

func SyncStrategies() []SyncStrategy

provides all valid sync strategies

func (SyncStrategy) String

func (self SyncStrategy) String() string

type SyncTags added in v15.1.0

type SyncTags bool

SyncTags contains the configuration setting whether to sync Git tags.

func (SyncTags) IsFalse added in v15.1.0

func (self SyncTags) IsFalse() bool

func (SyncTags) IsTrue added in v15.1.0

func (self SyncTags) IsTrue() bool

func (SyncTags) String added in v15.1.0

func (self SyncTags) String() string

type SyncUpstream

type SyncUpstream bool

SyncUpstream contains the configuration setting whether to sync with the upstream remote.

func (SyncUpstream) IsTrue added in v15.2.0

func (self SyncUpstream) IsTrue() bool

func (SyncUpstream) String

func (self SyncUpstream) String() string

type UnvalidatedConfig

type UnvalidatedConfig struct {
	Aliases                  Aliases
	ContributionBranches     gitdomain.LocalBranchNames
	CreatePrototypeBranches  CreatePrototypeBranches
	GitHubToken              Option[GitHubToken]
	GitLabToken              Option[GitLabToken]
	GitUserEmail             Option[GitUserEmail]
	GitUserName              Option[GitUserName]
	GiteaToken               Option[GiteaToken]
	HostingOriginHostname    Option[HostingOriginHostname]
	HostingPlatform          Option[HostingPlatform] // Some = override by user, None = auto-detect
	Lineage                  Lineage
	MainBranch               Option[gitdomain.LocalBranchName]
	ObservedBranches         gitdomain.LocalBranchNames
	Offline                  Offline
	ParkedBranches           gitdomain.LocalBranchNames
	PerennialBranches        gitdomain.LocalBranchNames
	PerennialRegex           Option[PerennialRegex]
	PrototypeBranches        gitdomain.LocalBranchNames
	PushHook                 PushHook
	PushNewBranches          PushNewBranches
	ShipDeleteTrackingBranch ShipDeleteTrackingBranch
	SyncFeatureStrategy      SyncFeatureStrategy
	SyncPerennialStrategy    SyncPerennialStrategy
	SyncPrototypeStrategy    SyncPrototypeStrategy
	SyncTags                 SyncTags
	SyncUpstream             SyncUpstream
}

UnvalidatedConfig is the Git Town configuration as read from disk. It might be lacking essential information in case Git metadata and config files don't contain it. If you need this information, validate it into a ValidatedConfig.

func DefaultConfig

func DefaultConfig() UnvalidatedConfig

DefaultConfig provides the default configuration data to use when nothing is configured.

func NewUnvalidatedConfig

func NewUnvalidatedConfig(configFile Option[PartialConfig], globalGitConfig, localGitConfig PartialConfig) UnvalidatedConfig

func (*UnvalidatedConfig) BranchType

func (self *UnvalidatedConfig) BranchType(branch gitdomain.LocalBranchName) BranchType

func (*UnvalidatedConfig) ContainsLineage

func (self *UnvalidatedConfig) ContainsLineage() bool

ContainsLineage indicates whether this configuration contains any lineage entries.

func (*UnvalidatedConfig) IsContributionBranch

func (self *UnvalidatedConfig) IsContributionBranch(branch gitdomain.LocalBranchName) bool

func (*UnvalidatedConfig) IsMainBranch

func (self *UnvalidatedConfig) IsMainBranch(branch gitdomain.LocalBranchName) bool

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

func (*UnvalidatedConfig) IsMainOrPerennialBranch

func (self *UnvalidatedConfig) 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 (*UnvalidatedConfig) IsObservedBranch

func (self *UnvalidatedConfig) IsObservedBranch(branch gitdomain.LocalBranchName) bool

func (*UnvalidatedConfig) IsOnline

func (self *UnvalidatedConfig) IsOnline() bool

func (*UnvalidatedConfig) IsParkedBranch

func (self *UnvalidatedConfig) IsParkedBranch(branch gitdomain.LocalBranchName) bool

func (*UnvalidatedConfig) IsPerennialBranch

func (self *UnvalidatedConfig) IsPerennialBranch(branch gitdomain.LocalBranchName) bool

func (*UnvalidatedConfig) IsPrototypeBranch

func (self *UnvalidatedConfig) IsPrototypeBranch(branch gitdomain.LocalBranchName) bool

func (*UnvalidatedConfig) MainAndPerennials

func (self *UnvalidatedConfig) MainAndPerennials() gitdomain.LocalBranchNames

func (*UnvalidatedConfig) MustKnowParent

func (self *UnvalidatedConfig) MustKnowParent(branch gitdomain.LocalBranchName) bool

func (*UnvalidatedConfig) NoPushHook

func (self *UnvalidatedConfig) NoPushHook() NoPushHook

func (*UnvalidatedConfig) Online

func (self *UnvalidatedConfig) Online() Online

func (*UnvalidatedConfig) ShouldPushNewBranches

func (self *UnvalidatedConfig) ShouldPushNewBranches() bool

type ValidatedConfig

type ValidatedConfig struct {
	GitUserEmail GitUserEmail
	GitUserName  GitUserName
	MainBranch   gitdomain.LocalBranchName
	*UnvalidatedConfig
}

ValidatedConfig is Git Town configuration where all essential values are guaranteed to exist and have meaningful values. This is ensured by querying from the user if needed.

func (*ValidatedConfig) BranchType

func (self *ValidatedConfig) BranchType(branch gitdomain.LocalBranchName) BranchType

func (*ValidatedConfig) IsMainBranch

func (self *ValidatedConfig) IsMainBranch(branch gitdomain.LocalBranchName) bool

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

func (*ValidatedConfig) IsMainOrPerennialBranch

func (self *ValidatedConfig) 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 (*ValidatedConfig) IsPerennialBranch

func (self *ValidatedConfig) IsPerennialBranch(branch gitdomain.LocalBranchName) bool

func (*ValidatedConfig) MainAndPerennials

func (self *ValidatedConfig) MainAndPerennials() gitdomain.LocalBranchNames

type Verbose

type Verbose bool

indicates whether a Git Town command should display all Git commands it executes

Jump to

Keyboard shortcuts

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