git

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: AGPL-3.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GIT       = "git"
	LOG       = "log"
	SHOW      = "show"
	REVPARSE  = "rev-parse"
	TOPLEVEL  = "--show-toplevel"
	NOPAGER   = "--no-pager"
	LOGFORMAT = "--pretty=%cD||%h||%s||%an||%ae"
	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) ([]*model.Commit, []error)

func CheckLocalRepoAvailable

func CheckLocalRepoAvailable(dir string) bool

func ConvertGithubCommitsIntoModel

func ConvertGithubCommitsIntoModel(ghCommits []*APICommit,
	progressChan chan *model.ProgressUpdate, progressErrorChan chan model.ProgressError) ([]*model.Commit, []error)

func ExtractHistoryFromFile

func ExtractHistoryFromFile(repoDirectory, filePath string,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError) ([]*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,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError) ([]*model.Commit, []error)

func ProcessGithubRepo

func ProcessGithubRepo(username string, repo string, filePath string,
	progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError,
	forceCutoff bool, limit int) ([]*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,
	progressChan chan *model.ProgressUpdate, progressErrorChan chan model.ProgressError,
	forceCutoff bool, limit 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