git

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookPrepareCommitMessageTemplate = "prepare-commit-msg"
	CommitMessageTemplate            = "commit-msg.tmpl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

func New

func New(opts ...Option) *Command

func (*Command) Commit

func (c *Command) Commit(val string) (string, error)

func (*Command) DiffFiles

func (c *Command) DiffFiles() (string, error)

Diff compares the differences between two sets of data. It returns a string representing the differences and an error. If there are no differences, it returns an empty string and an error.

func (*Command) GitDir

func (c *Command) GitDir() (string, error)

GitDir to show the (by default, absolute) path of the git directory of the working tree.

func (*Command) InstallHook

func (c *Command) InstallHook() error

func (*Command) IsDiffTag added in v1.0.5

func (c *Command) IsDiffTag() (is bool, tagNew, tagOld string)

IsDiffTag judge whether to compare the differences between the latest two tags

func (*Command) UninstallHook

func (c *Command) UninstallHook() error

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an interface that specifies instrumentation configuration options.

func WithCommitId added in v1.1.0

func WithCommitId(val string) Option

WithCommitId returns an Option that sets the commitId field of a config object to the given value.

func WithDiffTagPrefix added in v1.0.5

func WithDiffTagPrefix(val string) Option

WithDiffTagPrefix returns an Option that sets the diffTagPrefix field of a config object to the given value.

func WithDiffUnified

func WithDiffUnified(val int) Option

WithDiffUnified is a function that generate diffs with <n> lines of context instead of the usual three.

func WithEnableAmend

func WithEnableAmend(val bool) Option

WithEnableAmend returns an Option that sets the isAmend field of a config object to the given value.

func WithExcludeList

func WithExcludeList(val []string) Option

WithExcludeList returns an Option that sets the excludeList field of a config object to the given value.

Jump to

Keyboard shortcuts

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