gitparse

package
v3.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DateFormat = "Mon Jan 02 15:04:05 2006 -0700"

DateFormat is the standard date format for git.

Variables

This section is empty.

Functions

func FromReader added in v3.10.2

func FromReader(ctx context.Context, stdOut io.Reader, commitChan chan Commit)

func RepoPath

func RepoPath(ctx context.Context, source string, head string) (chan Commit, error)

RepoPath parses the output of the `git log` command for the `source` path.

func Unstaged added in v3.10.3

func Unstaged(ctx context.Context, source string) (chan Commit, error)

Unstaged parses the output of the `git diff` command for the `source` path.

Types

type Commit

type Commit struct {
	Hash    string
	Author  string
	Date    time.Time
	Message strings.Builder
	Diffs   []Diff
}

Commit contains commit header info and diffs.

type Diff

type Diff struct {
	PathB     string
	LineStart int
	Content   bytes.Buffer
	IsBinary  bool
}

Diff contains the info about a file diff in a commit.

Jump to

Keyboard shortcuts

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