Help us shape the future of Go! Take the 2026 Go Developer Survey

gitexec

package
v0.7.217 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package gitexec provides the low-level process boundary for local git commands.

Index

Constants

View Source
const MaxPatchBytes = 1 << 20

MaxPatchBytes is the most of a patch shown to a reader. Past it, the patch is cut, as a lockfile or generated code can make one tens of megabytes.

Variables

View Source
var PatchFlags = []string{"--no-color", "--no-ext-diff", "--no-textconv"}

PatchFlags make git's diff output a plain patch, whatever the user's git configuration says about colour, external diff tools and text conversion.

Functions

func CapPatch added in v0.7.217

func CapPatch(patch string) string

CapPatch cuts a patch to MaxPatchBytes at a line boundary, saying so when it had to.

Types

type Runner

type Runner struct {
	Dir string
	Env []string
}

Runner executes git commands in Dir.

func (Runner) CombinedOutput

func (r Runner) CombinedOutput(ctx context.Context, args ...string) ([]byte, error)

CombinedOutput runs git with args and returns its combined standard output and standard error.

func (Runner) Output

func (r Runner) Output(ctx context.Context, args ...string) ([]byte, error)

Output runs git with args and returns its standard output.

func (Runner) Run

func (r Runner) Run(ctx context.Context, args ...string) error

Run runs git with args.

Jump to

Keyboard shortcuts

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