Documentation
¶
Overview ¶
Package gitconfig provides functionality around storing Git Town configuration information as Git metadata. Git Town stores configuration in two locations: 1. Git metadata of the local repository. You can see it with `git config -l --local` 2. Global Git metadata. You can seet it with `git config -l --global`
Index ¶
- Constants
- Variables
- func AddKeyToPartialConfig(key Key, value string, config *configdomain.PartialConfig) error
- func AliasableCommandForKey(key Key) *configdomain.AliasableCommand
- type Access
- func (self *Access) LoadGlobal() (SingleSnapshot, configdomain.PartialConfig, error)
- func (self *Access) LoadLocal() (SingleSnapshot, configdomain.PartialConfig, error)
- func (self *Access) OriginRemote() string
- func (self *Access) RemoveGlobalConfigValue(key Key) error
- func (self *Access) RemoveLocalConfigValue(key Key) error
- func (self *Access) RemoveLocalGitConfiguration(lineage configdomain.Lineage) error
- func (self *Access) SetGlobalConfigValue(key Key, value string) error
- func (self *Access) SetLocalConfigValue(key Key, value string) error
- func (self *Access) UpdateDeprecatedGlobalSetting(oldKey, newKey Key, value string)
- func (self *Access) UpdateDeprecatedLocalSetting(oldKey, newKey Key, value string)
- func (self *Access) UpdateDeprecatedSetting(oldKey, newKey Key, value string, global bool)
- type Key
- type Runner
- type SingleSnapshot
Constants ¶
const ( KeyAliasAppend = Key("alias.append") 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") 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("git-town.github-token") 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") KeyPushHook = Key("git-town.push-hook") KeyPushNewBranches = Key("git-town.push-new-branches") KeyShipDeleteTrackingBranch = Key("git-town.ship-delete-tracking-branch") KeySyncBeforeShip = Key("git-town.sync-before-ship") KeySyncFeatureStrategy = Key("git-town.sync-feature-strategy") KeySyncPerennialStrategy = Key("git-town.sync-perennial-strategy") KeySyncStrategy = Key("git-town.sync-strategy") KeySyncUpstream = Key("git-town.sync-upstream") KeyGitUserEmail = Key("user.email") KeyGitUserName = Key("user.name") )
Variables ¶
var DeprecatedKeys = map[Key]Key{ KeyDeprecatedCodeHostingDriver: KeyHostingPlatform, KeyDeprecatedCodeHostingOriginHostname: KeyHostingOriginHostname, KeyDeprecatedCodeHostingPlatform: KeyHostingPlatform, KeyDeprecatedMainBranchName: KeyMainBranch, KeyDeprecatedNewBranchPushFlag: KeyPushNewBranches, KeyDeprecatedPerennialBranchNames: KeyPerennialBranches, KeyDeprecatedPullBranchStrategy: KeySyncPerennialStrategy, KeyDeprecatedPushVerify: KeyPushHook, KeyDeprecatedShipDeleteRemoteBranch: KeyShipDeleteTrackingBranch, KeyDeprecatedSyncStrategy: KeySyncFeatureStrategy, }
DeprecatedKeys defines the up-to-date counterparts to deprecated configuration settings.
Functions ¶
func AddKeyToPartialConfig ¶
func AddKeyToPartialConfig(key Key, value string, config *configdomain.PartialConfig) error
func AliasableCommandForKey ¶
func AliasableCommandForKey(key Key) *configdomain.AliasableCommand
Types ¶
type Access ¶
type Access struct {
Runner
}
Access provides typesafe access to the Git configuration on disk.
func (*Access) LoadGlobal ¶
func (self *Access) LoadGlobal() (SingleSnapshot, configdomain.PartialConfig, error)
LoadLocal reads the global Git Town configuration that applies to the entire machine.
func (*Access) LoadLocal ¶
func (self *Access) LoadLocal() (SingleSnapshot, configdomain.PartialConfig, error)
LoadLocal reads the Git Town configuration from the local Git's metadata for the current repository.
func (*Access) OriginRemote ¶
func (*Access) RemoveGlobalConfigValue ¶
func (*Access) RemoveLocalConfigValue ¶
removeLocalConfigurationValue deletes the configuration value with the given key from the local Git Town configuration.
func (*Access) RemoveLocalGitConfiguration ¶
func (self *Access) RemoveLocalGitConfiguration(lineage configdomain.Lineage) error
RemoveLocalGitConfiguration removes all Git Town configuration.
func (*Access) SetGlobalConfigValue ¶
SetGlobalConfigValue sets the given configuration setting in the global Git configuration.
func (*Access) SetLocalConfigValue ¶
SetLocalConfigValue sets the local configuration with the given key to the given value.
func (*Access) UpdateDeprecatedGlobalSetting ¶
func (*Access) UpdateDeprecatedLocalSetting ¶
type Key ¶
type Key string
Key contains all the keys used in Git Town's Git metadata configuration.
func KeyForAliasableCommand ¶
func KeyForAliasableCommand(aliasableCommand configdomain.AliasableCommand) Key
func NewParentKey ¶
func NewParentKey(branch gitdomain.LocalBranchName) Key
func (Key) MarshalJSON ¶
MarshalJSON is used when serializing this LocalBranchName to JSON.
func (*Key) UnmarshalJSON ¶
UnmarshalJSON is used when de-serializing JSON into a Location.
type SingleSnapshot ¶
SingleSnapshot contains all of the local or global Git metadata config settings.