Documentation ¶
Overview ¶
Package diff contains libraries for diffing packages.
Index ¶
Constants ¶
View Source
const ( // localPackageSource represents the local package LocalPackageSource string = "local" // remotePackageSource represents the remote version of the package RemotePackageSource string = "remote" // targetRemotePackageSource represents the targeted remote version of a package TargetRemotePackageSource string = "target" )
A collection of user-readable "source" definitions for diffed packages.
Variables ¶
View Source
var SupportedDiffTypes = []Type{TypeLocal, TypeRemote, TypeCombined, Type3Way}
Functions ¶
func NameStagingDirectory ¶ added in v0.38.1
NameStagingDirectory assigns a name that matches the package source information
func SupportedDiffTypesLabel ¶
func SupportedDiffTypesLabel() string
Types ¶
type Command ¶
type Command struct { // Path to the local package directory Path string // Ref is the target Ref in the upstream source package to compare against Ref string // DiffType specifies the type of changes to show DiffType Type // Difftool refers to diffing commandline tool for showing changes. DiffTool string // DiffToolOpts refers to the commandline options to for the diffing tool. DiffToolOpts string // When Debug is true, command will run with verbose logging and will not // cleanup the staged packages to assist with debugging. Debug bool // Output is an io.Writer where command will write the output of the // command. Output io.Writer // PkgDiffer specifies package differ PkgDiffer PkgDiffer // PkgGetter specifies packaging sourcing adapter PkgGetter PkgGetter }
Command shows changes in local package relative to upstream source pkg, changes in upstream source package between original and target version etc.
func (*Command) DefaultValues ¶
func (c *Command) DefaultValues()
DefaultValues sets up the default values for the command.
type PkgGetter ¶
type PkgGetter interface {
GetPkg(ctx context.Context, stagingDir, targetDir, repo, path, ref string) (dir string, err error)
}
PkgGetter knows how to fetch a package given a git repo, path and ref.
type Type ¶
type Type string
Type represents type of diff comparison to be performed.
const ( // TypeLocal shows the changes in local pkg relative to upstream source pkg at original version TypeLocal Type = "local" // TypeRemote shows changes in the upstream source pkg between original and target version TypeRemote Type = "remote" // TypeCombined shows changes in local pkg relative to upstream source pkg at target version TypeCombined Type = "combined" // 3way shows changes in local and remote changes side-by-side Type3Way Type = "3way" )
Click to show internal directories.
Click to hide internal directories.