gitconfig

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const NamePlaceholder = "<name>"

NamePlaceholder 名称占位符

Variables

This section is empty.

Functions

This section is empty.

Types

type BooleanProperty

type BooleanProperty interface {
	Get() bool
	Set(value bool)
}

BooleanProperty ...

type Branch added in v0.0.7

type Branch struct {
	Name   string
	Exists bool

	Merge       string // ='refs/heads/main'
	Remote      string // the remote name
	PushRemote  string
	Description string
}

Branch 表示 config["branch.<name>.*"]

type ConfigIndex added in v0.0.7

type ConfigIndex interface {
	GetConfig() repositories.Config

	ListClasses() []string

	ListNames(aClass string) []string

	// key like 'a.b.*'
	Contains(key string) bool
}

ConfigIndex ... [aaa.bbb.ccc] is [<class>.<name>.<field>]

type ConfigLoader added in v0.0.7

type ConfigLoader struct {
}

ConfigLoader ...

func (*ConfigLoader) GetIndex added in v0.0.7

func (inst *ConfigLoader) GetIndex(cfg repositories.Config) ConfigIndex

GetIndex ...

func (*ConfigLoader) LoadBranch added in v0.0.7

func (inst *ConfigLoader) LoadBranch(cfg repositories.Config, name string) *Branch

LoadBranch ...

func (*ConfigLoader) LoadCore added in v0.0.7

func (inst *ConfigLoader) LoadCore(cfg repositories.Config) *Core

LoadCore ...

func (*ConfigLoader) LoadRemote added in v0.0.7

func (inst *ConfigLoader) LoadRemote(cfg repositories.Config, name string) *Remote

LoadRemote ...

type Core added in v0.0.7

type Core struct {
	Exists bool

	Bare                    bool
	RepositoryFormatVersion int
}

Core ...

type FetchRefspecTemplate added in v0.0.7

type FetchRefspecTemplate string

FetchRefspecTemplate 表示一个 fetch 模板, like '+refs/heads/*:refs/remotes/origin/*', default key='remote.<name>.fetch'

func (FetchRefspecTemplate) GetLocalTemplate added in v0.0.7

func (t FetchRefspecTemplate) GetLocalTemplate() string

GetLocalTemplate ...

func (FetchRefspecTemplate) GetRemoteTemplate added in v0.0.7

func (t FetchRefspecTemplate) GetRemoteTemplate() string

GetRemoteTemplate ...

func (FetchRefspecTemplate) MakeLocalRefspecWithName added in v0.0.7

func (t FetchRefspecTemplate) MakeLocalRefspecWithName(name string) git.ReferenceName

MakeLocalRefspecWithName ...

func (FetchRefspecTemplate) MakeRemoteRefspecWithName added in v0.0.7

func (t FetchRefspecTemplate) MakeRemoteRefspecWithName(name string) git.ReferenceName

MakeRemoteRefspecWithName ...

func (FetchRefspecTemplate) String added in v0.0.7

func (t FetchRefspecTemplate) String() string

type FloatProperty

type FloatProperty interface {
	Get() float64
	Set(value float64)
}

FloatProperty ...

type Group added in v0.0.7

type Group Remotes

Group aka for Remotes

type IntProperty

type IntProperty interface {
	Get() int
	Set(value int)
}

IntProperty ...

type KeyTemplate

type KeyTemplate string

KeyTemplate 表示仓库配置的属性名模板

const (
	BranchSort             KeyTemplate = "branch.sort"
	BranchNameRemote       KeyTemplate = "branch.<name>.remote"
	BranchNamePushRemote   KeyTemplate = "branch.<name>.pushRemote"
	BranchNameMerge        KeyTemplate = "branch.<name>.merge"
	BranchNameMergeOptions KeyTemplate = "branch.<name>.mergeOptions"
	BranchNameRebase       KeyTemplate = "branch.<name>.rebase"
	BranchNameDescription  KeyTemplate = "branch.<name>.description"
)

定义仓库配置名称 (branch.*)

const (
	CoreLogAllRefUpdates        KeyTemplate = "core.logAllRefUpdates"
	CoreSymlinks                KeyTemplate = "core.symlinks"
	CoreIgnoreCase              KeyTemplate = "core.ignoreCase"
	CoreBare                    KeyTemplate = "core.bare"
	CoreRepositoryFormatVersion KeyTemplate = "core.repositoryFormatVersion"
	CoreFileMode                KeyTemplate = "core.fileMode"

	CoreCompressionAlgorithm KeyTemplate = "core.compressionAlgorithm"
	CoreDigestAlgorithm      KeyTemplate = "core.digestAlgorithm"
	CoreObjectsPathPattern   KeyTemplate = "core.objectsPathPattern"
)

定义仓库配置名称 (core.*)

const (
	RemoteNameURL     KeyTemplate = "remote.<name>.url"
	RemoteNamePushURL KeyTemplate = "remote.<name>.pushurl"
	RemoteNameProxy   KeyTemplate = "remote.<name>.proxy"
	RemoteNameFetch   KeyTemplate = "remote.<name>.fetch"
	RemoteNamePush    KeyTemplate = "remote.<name>.push"
	RemoteNameMirror  KeyTemplate = "remote.<name>.mirror"
)

定义仓库配置名称 (remote.*)

const (
	AuthorName        KeyTemplate = "author.name"
	AuthorEmail       KeyTemplate = "author.email"
	CommitterName     KeyTemplate = "committer.name"
	CommitterEmail    KeyTemplate = "committer.email"
	UserName          KeyTemplate = "user.name"
	UserEmail         KeyTemplate = "user.email"
	UserUseConfigOnly KeyTemplate = "user.useConfigOnly"
	UserSigningKey    KeyTemplate = "user.signingKey"
)

定义仓库配置名称 (user.*)

func (KeyTemplate) String added in v0.0.3

func (kt KeyTemplate) String() string

type Property

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

Property ...

type PropertyAccess

type PropertyAccess interface {
	ForString(template KeyTemplate, id string, def string) StringProperty
	ForInt(template KeyTemplate, id string, def int) IntProperty
	ForBool(template KeyTemplate, id string, def bool) BooleanProperty
	ForFloat(template KeyTemplate, id string, def float64) FloatProperty
}

PropertyAccess ...

type Remote added in v0.0.7

type Remote struct {
	Name   string
	Exists bool

	URL   string // ='git@github.com:example/example.git'
	Fetch string // ='+refs/heads/*:refs/remotes/origin/*'
}

Remote 表示 config["remote.<name>.*"]

type RemoteAndBranch added in v0.0.7

type RemoteAndBranch struct {
	RemoteName string
	Remote     *Remote
	Branch     *Branch
}

RemoteAndBranch 表示一组相关的 remote-branches

type Remotes added in v0.0.7

type Remotes struct {
	Name string

	RemoteNames []string
}

Remotes 表示一组 remote

type StringProperty

type StringProperty interface {
	Get() string
	Set(value string)
}

StringProperty ...

type UserProperties

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

UserProperties ...

func (*UserProperties) AuthorEmail

func (inst *UserProperties) AuthorEmail() StringProperty

AuthorEmail ...

func (*UserProperties) AuthorName

func (inst *UserProperties) AuthorName() StringProperty

AuthorName ...

func (*UserProperties) CommitterEmail

func (inst *UserProperties) CommitterEmail() StringProperty

CommitterEmail ...

func (*UserProperties) CommitterName

func (inst *UserProperties) CommitterName() StringProperty

CommitterName ...

func (*UserProperties) UserEmail

func (inst *UserProperties) UserEmail() StringProperty

UserEmail ...

func (*UserProperties) UserName

func (inst *UserProperties) UserName() StringProperty

UserName ...

func (*UserProperties) UserSigningKey

func (inst *UserProperties) UserSigningKey() StringProperty

UserSigningKey ...

func (*UserProperties) UserUseConfigOnly

func (inst *UserProperties) UserUseConfigOnly() BooleanProperty

UserUseConfigOnly ...

Jump to

Keyboard shortcuts

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