git

package
v0.0.98 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: GPL-3.0 Imports: 22 Imported by: 3 modules, 2 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 (
	GIT       = "git"
	LOG       = "log"
	SHOW      = "show"
	REVPARSE  = "rev-parse"
	TOPLEVEL  = "--show-toplevel"
	NOPAGER   = "--no-pager"
	FOLLOW    = "--follow"
	LOGFORMAT = "--pretty=%cD||%h||%s||%an||%ae"
	NUMBER    = "-n"
	DIV       = "--"
)
View Source
const GithubAuthHeader = "Authorization"
View Source
const GithubRepoAPI = "https://api.github.com/repos/"
View Source
const GithubToken = "GH_TOKEN"

Variables

This section is empty.

Functions

func BuildCommitChangelog

func BuildCommitChangelog(commitHistory []*model.Commit,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, base string, remote, extRefs bool,
	breakingConfig *whatChangedModel.BreakingRulesConfig,
) ([]*model.Commit, []error)

TODO: we have reached peak argument count, we have to fix this.

func CheckLocalRepoAvailable

func CheckLocalRepoAvailable(dir string) bool

func ConvertGithubCommitsIntoModel

func ConvertGithubCommitsIntoModel(ghCommits []*APICommit,
	progressChan chan *model.ProgressUpdate, progressErrorChan chan model.ProgressError, base string, remote, extRefs bool,
	breakingConfig *whatChangedModel.BreakingRulesConfig,
) ([]*model.Commit, []error)

func ExtractHistoryFromFile

func ExtractHistoryFromFile(repoDirectory, filePath, baseCommit string,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, globalRevisions bool, limit int, limitTime int,
) ([]*model.Commit, []error)

func ExtractPathAndFile

func ExtractPathAndFile(location string) (string, string)

func GetTopLevel

func GetTopLevel(dir string) (string, error)

func PopulateHistoryWithChanges

func PopulateHistoryWithChanges(commitHistory []*model.Commit, limit int, limitTime int,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, base string, remote, extRefs bool,
	breakingConfig *whatChangedModel.BreakingRulesConfig,
) ([]*model.Commit, []error)

func ProcessGithubRepo

func ProcessGithubRepo(username, repo, filePath, baseCommit string,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,
	forceCutoff bool, limit int, limitTime int, base string, remote, extRefs bool,
	breakingConfig *whatChangedModel.BreakingRulesConfig,
) ([]*model.Commit, []error)

Types

type APICommit

type APICommit struct {
	Hash          string            `json:"sha"`
	CommitDetails *APICommitDetails `json:"commit"`
	URL           string            `json:"url"`
	Files         []*APIFile        `json:"files"`
}

func GetCommitsForGithubFile

func GetCommitsForGithubFile(user, repo, path string, baseCommit string,
	progressChan chan *model.ProgressUpdate, progressErrorChan chan model.ProgressError,
	forceCutoff bool, limit int, limitTime int) ([]*APICommit, error)

type APICommitAuthor

type APICommitAuthor struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Date  string `json:"date"`
}

type APICommitDetails

type APICommitDetails struct {
	Author  *APICommitAuthor `json:"author"`
	Message string           `json:"message"`
	URL     string           `json:"url"`
}

type APIFile

type APIFile struct {
	RawURL  string `json:"raw_url"`
	BlobURL string `json:"blob_url"`
	Hash    string `json:"sha"`
	Bytes   []byte `json:"-"`
}

Jump to

Keyboard shortcuts

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