Documentation
¶
Index ¶
- func BufferToDiff(buff bytes.Buffer, colorLeft bool, dumbterm bool, minimal bool) string
- func ColorDiff(dmp *diffmatchpatch.DiffMatchPatch, diffs []diffmatchpatch.Diff, ...) string
- func Fail(msg string, params ...interface{})
- func Info(msg string, params ...interface{})
- func LineAtPosition(records []LineOffset, pos uint32) int
- func LocalFileTrees(cmd string, switches []string, options types.Options, langName string, ...) (string, []byte, []byte)
- func Max[T constraints.Ordered](a, b T) T
- func Min[T constraints.Ordered](a, b T) T
- func RevisionToCurrentTree(filename string, cmd string, switches []string, options types.Options, ...) ([]byte, []byte)
- func SemanticChanges(dmp *diffmatchpatch.DiffMatchPatch, diffs []diffmatchpatch.Diff, ...) string
- func VerifyHash(filename string, digest string) bool
- type LineOffset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BufferToDiff ¶
func ColorDiff ¶
func ColorDiff( dmp *diffmatchpatch.DiffMatchPatch, diffs []diffmatchpatch.Diff, parseType types.ParseType, dumbterm bool, minimal bool) string
ColorDiff converts (DiffMatchPatch, []Diff) into colored text report
func LineAtPosition ¶
func LineAtPosition(records []LineOffset, pos uint32) int
Return the line number identified. Use -1 as sentinel for "not found" TODO: if we care about speed, we can do a bisection search of the well-ordered {start, end, line} structures
func LocalFileTrees ¶
func Max ¶
func Max[T constraints.Ordered](a, b T) T
func Min ¶
func Min[T constraints.Ordered](a, b T) T
func RevisionToCurrentTree ¶
func SemanticChanges ¶
func SemanticChanges( dmp *diffmatchpatch.DiffMatchPatch, diffs []diffmatchpatch.Diff, filename string, headTree []byte, headTreeString string, parseType types.ParseType, dumbterm bool, minimal bool) string
func VerifyHash ¶
Types ¶
type LineOffset ¶
func MakeOffsetsFromByteArray ¶
func MakeOffsetsFromByteArray(text []byte) []LineOffset
We assume that lines are sensibly split on LF, not CR or CRLF Also assume that bytes encode text as UTF-8 not any odd encoding
func MakeOffsetsFromString ¶
func MakeOffsetsFromString(text string) []LineOffset
We assume that lines are sensibly split on LF, not CR or CRLF
Click to show internal directories.
Click to hide internal directories.