diff3

package
v0.6.8-ci.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Overview

Package diff3 implements a three-way merge algorithm Original version in Javascript by Bryan Housel @bhousel: https://github.com/bhousel/node-diff3, which in turn is based on project Synchrotron, created by Tony Garnock-Jones. For more detail please visit: http://homepages.kcbbs.gen.nz/tonyg/projects/synchrotron.html https://github.com/tonyg/synchrotron

Ported to go by Javier Peletier @jpeletier

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conflict

type Conflict struct {
	// contains filtered or unexported fields
}

Conflict describes a merge conflict

type Diff3MergeResult

type Diff3MergeResult struct {
	// contains filtered or unexported fields
}

Diff3MergeResult describes a merge result

func Diff3Merge

func Diff3Merge(a, o, b []string, excludeFalseConflicts bool) []*Diff3MergeResult

Diff3Merge applies the output of diff3MergeIndices to actually construct the merged file; the returned result alternates between 'ok' and 'conflict' blocks.

type MergeResult

type MergeResult struct {
	Conflicts bool      //Conflict indicates if there is any merge conflict
	Result    io.Reader // returns a reader that contains the merge result
}

MergeResult describes a merge result

func Merge

func Merge(a, o, b io.Reader, detailed bool, labelA string, labelB string) (*MergeResult, error)

Merge takes three streams and returns the merged result

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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