git

package
v0.44.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitMessage added in v0.17.0

func CommitMessage(cmd CommandRunner, sha string) (string, error)

func CountLines added in v0.40.1

func CountLines(body []byte) (lines []int)

func CurrentBranch

func CurrentBranch(cmd CommandRunner) (string, error)

func HeadCommit

func HeadCommit(cmd CommandRunner) (string, error)

func RunGit

func RunGit(args ...string) (content []byte, err error)

Types

type BodyDiff added in v0.40.1

type BodyDiff struct {
	Before        []byte
	After         []byte
	ModifiedLines []int
}

type CommandRunner

type CommandRunner func(args ...string) ([]byte, error)

type CommitRangeResults

type CommitRangeResults struct {
	From    string
	To      string
	Commits []string
}

func CommitRange

func CommitRange(cmd CommandRunner, baseBranch string) (CommitRangeResults, error)

func (CommitRangeResults) String

func (gcr CommitRangeResults) String() string

type FileBlames

type FileBlames map[string]LineBlames

type FileChange added in v0.40.1

type FileChange struct {
	Commits []string
	Path    PathDiff
	Body    BodyDiff
}

func Changes added in v0.40.1

func Changes(cmd CommandRunner, cr CommitRangeResults) ([]*FileChange, error)

type FileStatus added in v0.40.1

type FileStatus rune
const (
	FileAdded       FileStatus = 'A'
	FileCopied      FileStatus = 'C'
	FileDeleted     FileStatus = 'D'
	FileRenamed     FileStatus = 'R'
	FileModified    FileStatus = 'M'
	FileTypeChanged FileStatus = 'T'
)

type LineBlame

type LineBlame struct {
	Filename string
	Line     int
	Commit   string
}

type LineBlames

type LineBlames []LineBlame

func Blame

func Blame(cmd CommandRunner, path string) (lines LineBlames, err error)

type Path added in v0.40.1

type Path struct {
	Name          string
	Type          PathType
	SymlinkTarget string
}

func (Path) EffectivePath added in v0.40.1

func (p Path) EffectivePath() string

type PathDiff added in v0.40.1

type PathDiff struct {
	Before Path
	After  Path
}

type PathType added in v0.40.1

type PathType int
const (
	Missing PathType = iota
	Dir
	File
	Symlink
)

type TypeDiff added in v0.40.1

type TypeDiff struct {
	Before PathType
	After  PathType
}

Jump to

Keyboard shortcuts

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