{"modulePath":"github.com/pb33f/openapi-changes","version":"v0.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\n## Constants\n\n```go\nconst (\n\tGIT       = \"git\"\n\tLOG       = \"log\"\n\tSHOW      = \"show\"\n\tREVPARSE  = \"rev-parse\"\n\tTOPLEVEL  = \"--show-toplevel\"\n\tNOPAGER   = \"--no-pager\"\n\tFOLLOW    = \"--follow\"\n\tLOGFORMAT = \"--pretty=%cD||%h||%s||%an||%ae\"\n\tNUMBER    = \"-n\"\n\tDIV       = \"--\"\n)\n```\n\n```go\nconst GithubToken = \"GH_TOKEN\"\n```\n\n## Functions\n\n```go\nfunc BuildChangelog(commitHistory []*model.Commit,\n\tprogressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,\n\topts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig,\n) ([]*model.Commit, []error)\n```\nBuildChangelog 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.\n\n```go\nfunc BuildRevisionDocumentConfiguration(ctx *RevisionDocumentContext, revision string,\n\tbaseDocConfig *datamodel.DocumentConfiguration,\n) (*datamodel.DocumentConfiguration, error)\n```\n\n```go\nfunc CanonicalizePath(path string) (string, error)\n```\n\n```go\nfunc CheckLocalRepoAvailable(dir string) bool\n```\n\n```go\nfunc ExtractHistoryFromFile(repoDirectory, filePath string,\n\tprogressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, opts HistoryOptions,\n) ([]*model.Commit, []error)\n```\n\n```go\nfunc ExtractPathAndFile(location string) (string, string)\n```\n\n```go\nfunc GetTopLevel(dir string) (string, error)\n```\n\n```go\nfunc NewRepoRelativeDocumentPathRewriter(repoRoot, basePath string) model.DocumentPathRewriter\n```\n\n```go\nfunc PopulateHistory(commitHistory []*model.Commit,\n\tprogressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,\n\topts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig,\n) ([]*model.Commit, []error)\n```\n\n```go\nfunc ProcessGithubRepo(username, repo, filePath string,\n\tprogressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,\n\topts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig,\n) ([]*model.Commit, []error)\n```\n\n```go\nfunc ReadFileAtRevision(repoDir, revision, filePath string) ([]byte, error)\n```\nReadFileAtRevision reads a file from a git repository at the given revision.\n\n```go\nfunc ResolveBaseOverride(base string) (string, *url.URL, error)\n```\n\n## Types\n\n```go\ntype GitRevisionFS struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewGitRevisionFS(repoRoot, baseDir, revision string, docConfig *datamodel.DocumentConfiguration) (*GitRevisionFS, error)\n```\n\n```go\nfunc (g *GitRevisionFS) GetFiles() map[string]index.RolodexFile\n```\n\n```go\nfunc (g *GitRevisionFS) Open(name string) (fs.File, error)\n```\n\n```go\nfunc (g *GitRevisionFS) SetLogger(logger *slog.Logger)\n```\n\n```go\nfunc (g *GitRevisionFS) SetRolodex(rolodex *index.Rolodex)\n```\n\n```go\ntype HistoryBuildResult struct {\n\tCommits        []*model.Commit\n\tSkippedCommits []string\n}\n```\nHistoryBuildResult contains the comparable commit history produced by the git/GitHub normalization layer plus any skipped revisions.\n\n```go\nfunc PopulateHistoryDetailed(commitHistory []*model.Commit,\n\tprogressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,\n\topts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig,\n) (*HistoryBuildResult, []error)\n```\nPopulateHistory 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).\n\n```go\nfunc ProcessGithubRepoDetailed(username, repo, filePath string,\n\tprogressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,\n\topts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig,\n) (*HistoryBuildResult, []error)\n```\nProcessGithubRepo fetches file history from GitHub and builds the commit changelog. Set opts.KeepComparable to preserve revisions even when the legacy libopenapi diff is empty.\n\n```go\ntype HistoryOptions struct {\n\tReadRevision    func(repo, revision, path string) ([]byte, error) // optional hosted revision reader\n\tLazy            bool                                              // prepare sources now and retain only the active model window\n\tBase            string\n\tRemote          bool\n\tExtRefs         bool\n\tKeepComparable  bool // true = preserve Documents on commits even when legacy diff is empty\n\tLimit           int\n\tLimitTime       int\n\tForceCutoff     bool // GitHub only\n\tGlobalRevisions bool // ExtractHistoryFromFile only\n\tBaseCommit      string\n}\n```\nHistoryOptions 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.\n\n```go\ntype RevisionDocumentContext struct {\n\tRepoRoot         string\n\tRepoFilePath     string\n\tSpecFilePath     string\n\tBasePath         string\n\tBaseURL          *url.URL\n\tDocumentRewriter model.DocumentPathRewriter\n}\n```\n\n```go\nfunc BuildRevisionDocumentContext(repoDir, filePath, basePathOverride string, baseURLOverride *url.URL) (*RevisionDocumentContext, error)\n```\n\n","path":"github.com/pb33f/openapi-changes/git","name":"git","synopsis":"","isRedistributable":true}
