patch

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package patch provides support for generating a patch and patch file between two commits.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trailers

func Trailers() []string

Trailers are a list of known Git trailers, including the well-known 'Signed-off-by' that are recognised in a Git message.

Types

type Patch

type Patch struct {
	Title       string
	Hash        string
	Message     string
	Trailers    []string
	AuthorName  string
	AuthorEmail string
	AuthorDate  string
	Filename    string
	Stat        string
	Diff        string
}

Patch represents a specific commit and all the metadata associated with the specific commit.

func NewPatchFromCommits

func NewPatchFromCommits(ctx context.Context, repoPath string, commit, diff *gitobject.Commit) (*Patch, error)

NewPatchFromCommits accepts two commits which are used to generate a patch.

func (*Patch) Bytes

func (p *Patch) Bytes() []byte

func (*Patch) String

func (p *Patch) String() string

Jump to

Keyboard shortcuts

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