merge

package
v0.0.0-...-ac8ef6d Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

This package provides the procedures used to merge different versions of a generated configuration. Usually this is needed when you have both updated the YAML outputs and updated the spec file containing the definition for how they are generated.

This is like git merge: the idea is to find a common ancestor, then find the changes made from that "base" to obtain the resources in the working directory ("theirs") and apply those chnges to the resources generated by the spec file as modified ("ours").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Merge

func Merge(mineNodes, origNodes, yoursNodes []*yaml.RNode) ([]*yaml.RNode, error)

Merge takes three sets of resources -- mine (aka dest), orig (aka base, aka older), and yours (aka updated) -- and does a three-way merge. It returns an error if the merge has conflicts.

See https://www.gnu.org/software/diffutils/manual/html_node/diff3-Merging.html for more information about three-way merge.

TODO don't fail utterly when there's conflicts; report the conflicts instead, or add conflict markers somehow.

Types

This section is empty.

Jump to

Keyboard shortcuts

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