Documentation ¶
Index ¶
- Constants
- Variables
- func CloneGroup(groupUrl, token, targetDir string)
- func GetAllGitRepoCommitLog(detail bool, recentN int16, dir, author, start, end string, branchs bool) (*[]ResultLog, error)
- func GetAllGitRepoStatus(dir string)
- func GetChangedFile(commitId string) ([]string, error)
- func GetCommitLog(detail bool, recentN int16, dir, author, start, end string, branchs bool) (*[]CommitLog, error)
- func ListRepoAllBranch(repo string) (re *branchInfo)
- func UpdateAllGitRepo(dir string)
- type CommitLog
- type ConsoleOutput
- type FileOutput
- type OutputFormatter
- type ProjectInfo
- type ResultLog
Constants ¶
View Source
const REPORT_PATH = "./commit.log"
Variables ¶
View Source
var ( //git log LOG_TPL = "git -C %s --no-pager log %s --no-merges " LOG_FORMAT_TPL = `--format=format:'%h*-*%an*-*%ct*-*%s' ` //使用*-*作为分隔符 LOG_AUTHOR_TPL = `--author=%s ` LOG_START_DATE_TPL = `--since=%s ` LOG_END_DATE_TPL = `--until=%s ` LOG_RECENTN_TPL = `-n %d ` // git show SHOW_TPL = "git show %s" // git status STATUS_TPL = "git -C %s status" // git status in short result STATUS_CHECK_TPL = "git -C %s status -s" //git pull GIT_PULL = `git -C %s pull --rebase` // git clone CLONE_TPL = "git clone %s %s" // git lab group api // gitlab doc https://docs.gitlab.com/ee/api/groups.html#details-of-a-group GITLAB_GROUP_DETAIL = "%s://%s/api/v4/groups%s?private_token=%s" // Determine if the current directory is a git repository EXIST_GIT_REPO = "git rev-parse --is-inside-work-tree" //git Branch GIT_BRANCH = `git branch` )
Functions ¶
func GetAllGitRepoCommitLog ¶
func GetAllGitRepoCommitLog(detail bool, recentN int16, dir, author, start, end string, branchs bool) (*[]ResultLog, error)
GetAllGitRepoCommitLog 封装所有仓库的提交信息
func GetChangedFile ¶
GetChangedFile 获取本次提交变动的文件名
func GetCommitLog ¶
func GetCommitLog(detail bool, recentN int16, dir, author, start, end string, branchs bool) (*[]CommitLog, error)
GetCommitLog 获取提交日志
func ListRepoAllBranch ¶
func ListRepoAllBranch(repo string) (re *branchInfo)
ListRepoAllBranch list all git Branch under repository
Types ¶
type CommitLog ¶
type CommitLog struct { Branch string //Branch CommitHash string //abbreviated commit hash Username string //username CommitAt string //commit time CommitMsg string //commit log FilesChanged []string //changed file arr }
CommitLog 提交记录
type ConsoleOutput ¶
type ConsoleOutput struct { }
func (*ConsoleOutput) Output ¶
func (c *ConsoleOutput) Output(resLogs *[]ResultLog)
type FileOutput ¶
type FileOutput struct { }
func (*FileOutput) Output ¶
func (c *FileOutput) Output(resLogs *[]ResultLog)
type OutputFormatter ¶
type OutputFormatter interface {
Output(*[]ResultLog)
}
type ProjectInfo ¶
Click to show internal directories.
Click to hide internal directories.