git

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Username string = "username"
	Email    string = "username@domain.com"
)

Variables

View Source
var (
	ErrStrOpeningRepo                   = "opening repository"
	ErrStrRetrievingGlobalConfiguration = "retrieving global git configuration"
	ErrStrRetrievingWorkTree            = "retrieving git worktree"
	ErrStrCommittingChanges             = "committing changes"
	ErrStrTaggingChanges                = "tagging changes"
	ErrStrLoadingConfiguration          = "loading git configuration from global scope"

	ErrStrFormattedStagingAFile = "staging a file %s"
)

Functions

func GetRepoFromFileSystem

func GetRepoFromFileSystem(meta billy.Filesystem, data billy.Filesystem) (*git.Repository, error)

func Init

func Init(meta billy.Filesystem, data billy.Filesystem) error

Types

type ConfigParser

type ConfigParser struct {
	Config *config.Config
}

func (*ConfigParser) GetSectionOption

func (cp *ConfigParser) GetSectionOption(section string, option string) string

func (*ConfigParser) LoadConfig

func (cp *ConfigParser) LoadConfig(scope config.Scope) (*config.Config, error)

func (*ConfigParser) SetConfig

func (cp *ConfigParser) SetConfig(config *config.Config)

type ConfigParserInterface

type ConfigParserInterface interface {
	GetSectionOption(string, string) string
	SetConfig(*config.Config)
	LoadConfig(config.Scope) (*config.Config, error)
}

type Instance

type Instance struct {
	Repository RepositoryInterface
	Worktree   WorktreeInterface
	Config     *config.Config
}

func GetInstanceFromRepo

func GetInstanceFromRepo(repo RepositoryInterface) (*Instance, error)

func New

func New(meta billy.Filesystem, data billy.Filesystem) (*Instance, error)

func (*Instance) Commit

func (i *Instance) Commit(files []string, version string, sign *object.Signature, entity *openpgp.Entity) (plumbing.Hash, error)

func (*Instance) GetSigningKeyFromConfig

func (i *Instance) GetSigningKeyFromConfig(configParser ConfigParserInterface) (string, error)

func (*Instance) Save

func (i *Instance) Save(files []string, version string, gpgEntity *openpgp.Entity) error

type RepositoryInterface

type RepositoryInterface interface {
	Worktree() (*git.Worktree, error)
	CreateTag(string, plumbing.Hash, *git.CreateTagOptions) (*plumbing.Reference, error)
	ConfigScoped(config.Scope) (*config.Config, error)
}

type WorktreeInterface

type WorktreeInterface interface {
	Add(string) (plumbing.Hash, error)
	Commit(string, *git.CommitOptions) (plumbing.Hash, error)
}

Jump to

Keyboard shortcuts

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