gitconfig

package
v20.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 10 Imported by: 0

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	Runner
}

Access provides typesafe access to the Git configuration on disk.

func (*Access) Load

func (self *Access) Load(scopeOpt Option[configdomain.ConfigScope], updateOutdated bool) (configdomain.SingleSnapshot, error)

func (*Access) RemoteURL

func (self *Access) RemoteURL(remote gitdomain.Remote) Option[string]

func (*Access) RemoveConfigValue

func (self *Access) RemoveConfigValue(scope configdomain.ConfigScope, key configdomain.Key) error

func (*Access) RemoveLocalConfigValue

func (self *Access) RemoveLocalConfigValue(key configdomain.Key) error

removeLocalConfigurationValue deletes the configuration value with the given key from the local Git Town configuration.

func (*Access) RemoveLocalGitConfiguration

func (self *Access) RemoveLocalGitConfiguration(localSnapshot configdomain.SingleSnapshot) error

RemoveLocalGitConfiguration removes all Git Town configuration.

func (*Access) SetConfigValue

func (self *Access) SetConfigValue(scope configdomain.ConfigScope, key configdomain.Key, value string) error

SetConfigValue sets the given configuration setting in the global Git configuration.

func (*Access) UpdateDeprecatedSetting

func (self *Access) UpdateDeprecatedSetting(scope configdomain.ConfigScope, oldKey, newKey configdomain.Key, value string)

func (*Access) UpdateExternalGitTownAlias

func (self *Access) UpdateExternalGitTownAlias(scope configdomain.ConfigScope, key configdomain.Key, oldValue, newValue string)

updates a custom Git alias (not set up by Git Town)

type Runner

type Runner interface {
	Query(executable string, args ...string) (string, error)
	Run(executable string, args ...string) error
}

Jump to

Keyboard shortcuts

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