git

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverGitRepos

func DiscoverGitRepos(rootPath, language string) ([]string, error)

DiscoverGitRepos 发现指定目录下的所有Git仓库

func GetGitUserName

func GetGitUserName(repoPath, language string) (string, error)

GetGitUserName 获取Git用户名

func NormalizePath

func NormalizePath(path string) (string, error)

NormalizePath expands a leading tilde and returns an absolute path.

Types

type CommitInfo

type CommitInfo struct {
	Hash         string
	Author       string
	Date         time.Time
	Message      string
	Branches     []string // 分支信息
	ChangedFiles []string
	RepoPath     string // 仓库路径,标识提交来自哪个仓库
}

CommitInfo 表示一个Git提交的信息

func GetCommitDetails

func GetCommitDetails(hash string, opts *Options) (*CommitInfo, error)

GetCommitDetails 获取指定提交的详细信息

func GetCommitsBetween

func GetCommitsBetween(fromDate, toDate time.Time, opts *Options) ([]CommitInfo, error)

GetCommitsBetween 获取指定时间范围内的所有提交

func GetCommitsThisWeek

func GetCommitsThisWeek(opts *Options) ([]CommitInfo, error)

GetCommitsThisWeek 获取本周的所有提交

type Options

type Options struct {
	RepoPath string // Git仓库路径
	Author   string // 作者名称,用于筛选提交
	Language string
}

Options Git操作的选项

func NewGitOptions

func NewGitOptions(repoPath string) *Options

NewGitOptions 创建新的Git选项

func NewGitOptionsWithLanguage

func NewGitOptionsWithLanguage(repoPath, language string) *Options

NewGitOptionsWithLanguage 创建带语言信息的Git选项

Jump to

Keyboard shortcuts

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