modulepackage
0.0.0-20241115194849-280ec18688b6
Repository: https://github.com/epiclabs-io/diff3.git
Documentation: pkg.go.dev
# README
diff3
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
How to use:
Import the package and call Merge
:
Merge(a, o, b io.Reader, detailed bool, labelA string, labelB string) (*MergeResult, error)
Where:
a
andb
are the current and incoming versions of contento
is the common ancestordetailed
specifies whether you want the merge conflicts to be detailed.labelA
andlabelB
indicate a label to mark conflicts with, usually the branch names.
Returns a MergeResult
that includes a flag indicating whether there were conflicts or not and a io.Reader
stream with the result.
# Packages
No description provided by the author
# Functions
Diff3Merge applies the output of diff3MergeIndices to actually construct the merged file; the returned result alternates between 'ok' and 'conflict' blocks.
Merge takes three streams and returns the merged result.
# Structs
Conflict describes a merge conflict.
Diff3MergeResult describes a merge result.
MergeResult describes a merge result.