git

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 20 Imported by: ? modules, 0 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"
	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, base string, remote bool) ([]*model.Commit, []error)

func CheckLocalRepoAvailable

func CheckLocalRepoAvailable(dir string) bool

func ConvertGithubCommitsIntoModel

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

func ExtractHistoryFromFile

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