git

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Cmd = "git"
View Source
const CommitMessagePattern = `^(?:fixup!\s*)?(\w*)(\(([\w\$\.\*/-].*)\))?\: (.*)|^Merge\ branch(.*)`
View Source
const CommitTpl = `{{ .Type }}({{ .Scope }}): {{ .Subject }}

{{ .Body }}

{{ .Footer }}

{{ .Sob }}
`

Variables

This section is empty.

Functions

func CheckCommitMessage

func CheckCommitMessage(file string)

func CheckGitProject

func CheckGitProject()

func CheckStagedFiles

func CheckStagedFiles() bool

func Checkout

func Checkout(prefix CommitType, branch string)

func Commit

func Commit(cm *Message)

提交

func GenSOB

func GenSOB() string

生成 SOB 签名

func GetCurrentBranch

func GetCurrentBranch() string

func GetLastCommitInfo

func GetLastCommitInfo() *[]string

func InputBody

func InputBody() string

输入完整提交信息

func InputFooter

func InputFooter() string

输入提交关联信息

func InputScope

func InputScope() string

输入影响范围

func InputSubject

func InputSubject() string

输入提交主题

func Push

func Push()

func Rebase

func Rebase(sourceBranch string, targetBranch string)

Types

type CommitType

type CommitType string
const (
	FEAT     CommitType = "feat"
	FIX      CommitType = "fix"
	DOCS     CommitType = "docs"
	STYLE    CommitType = "style"
	REFACTOR CommitType = "refactor"
	TEST     CommitType = "test"
	CHORE    CommitType = "chore"
	PERF     CommitType = "perf"
	HOTFIX   CommitType = "hotfix"
	EXIT     CommitType = "exit"
)

func SelectCommitType

func SelectCommitType() CommitType

选择提交类型

type Message

type Message struct {
	Type    CommitType
	Scope   string
	Subject string
	Body    string
	Footer  string
	Sob     string
}

type RepoType

type RepoType string

type TypeMessage

type TypeMessage struct {
	Type          CommitType
	ZHDescription string
	ENDescription string
}

Jump to

Keyboard shortcuts

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