repositorypackage
0.0.0-20201028004128-47bbd14e77c4
Repository: https://github.com/google/go-patchutils.git
Documentation: pkg.go.dev
# Packages
Package main provides a cli tool to compute the diff between source and diff files.
# README
go-patchutils

Package patchutils provides tools to compute the diff between source and diff files.
Works with diff files in unified format.
Table of contents
Design
Interdiff mode

InterDiff computes the diff of a source file patched with oldDiff and the same source file patched with newDiff, without access to the source.
Example
oldDiff | newDiff |
---|---|
|
|
result | |
|
Mixed mode

MixedMode computes the diff of an oldSource patched with oldDiff and newSource patched with newDiff.
Example
oldSource | newSource |
---|---|
|
|
oldDiff | newDiff |
|
|
oldSource + oldDiff | newSource + newDiff |
|
|
result | |
|
Installation
go get -u github.com/google/go-patchutils
Usage
API
Godoc is available.
CLI tool
Build CLI tool
cd cli
go build
Interdiff mode
./cli interdiff -olddiff=<path_to_old_diff> -newdiff=<path_to_new_diff>
Mixed mode
./cli mixed -oldsource=<path_to_old_source> -olddiff=<path_to_old_diff>
-newsource=<path_to_new_source> -newdiff=<path_to_new_diff>