git

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: Apache-2.0 Imports: 20 Imported by: 2

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 GithubToken = "GH_TOKEN"

Variables

This section is empty.

Functions

func BuildChangelog added in v0.1.0

func BuildChangelog(commitHistory []*model.Commit,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,
	opts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig,
) ([]*model.Commit, []error)

BuildChangelog compares consecutive commits and populates each with parsed documents and change data. Set opts.KeepComparable to preserve revisions even when the legacy libopenapi diff is empty.

func CheckLocalRepoAvailable

func CheckLocalRepoAvailable(dir string) bool

func ExtractHistoryFromFile

func ExtractHistoryFromFile(repoDirectory, filePath string,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, opts HistoryOptions,
) ([]*model.Commit, []error)

func ExtractPathAndFile

func ExtractPathAndFile(location string) (string, string)

func GetTopLevel

func GetTopLevel(dir string) (string, error)

func PopulateHistory added in v0.1.0

func PopulateHistory(commitHistory []*model.Commit,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,
	opts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig,
) ([]*model.Commit, []error)

PopulateHistory reads file data from git for each commit, then builds the changelog. Set opts.KeepComparable to preserve revisions even when the legacy libopenapi diff is empty (used by the doctor/changerator-based commands).

func ProcessGithubRepo

func ProcessGithubRepo(username, repo, filePath string,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,
	opts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig,
) ([]*model.Commit, []error)

ProcessGithubRepo fetches file history from GitHub and builds the commit changelog. Set opts.KeepComparable to preserve revisions even when the legacy libopenapi diff is empty.

Types

type HistoryOptions added in v0.1.0

type HistoryOptions struct {
	Base            string
	Remote          bool
	ExtRefs         bool
	KeepComparable  bool // true = preserve Documents on commits even when legacy diff is empty
	Limit           int
	LimitTime       int
	ForceCutoff     bool // GitHub only
	GlobalRevisions bool // ExtractHistoryFromFile only
	BaseCommit      string
}

HistoryOptions controls how git history is fetched, traversed, and compared. BreakingConfig is intentionally kept as a separate parameter in function signatures — it controls comparison semantics, not history traversal.

Jump to

Keyboard shortcuts

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