All Projects → google → go-patchutils

google / go-patchutils

Licence: ISC license
go-patchutils is a library written in Go to show differences in source and diff files.

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to go-patchutils

duff
Pure OCaml implementation of libXdiff (Rabin's fingerprint)
Stars: ✭ 20 (+5.26%)
Mutual labels:  diff
Differentia.js
No longer being supported or maintained. A Graph Theory & Data Structure Library for JavaScript.
Stars: ✭ 13 (-31.58%)
Mutual labels:  diff
diffview.nvim
Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Stars: ✭ 1,472 (+7647.37%)
Mutual labels:  diff
react-rich-diff
React component to render rich diff between two documents (Markdown, HTML)
Stars: ✭ 51 (+168.42%)
Mutual labels:  diff
microdiff
A fast, zero dependency object and array comparison library. Significantly faster than most other deep comparison libraries and has full TypeScript support.
Stars: ✭ 3,138 (+16415.79%)
Mutual labels:  diff
lcs-image-diff-rs
🖼 Image diff tool with LCS algorithm
Stars: ✭ 67 (+252.63%)
Mutual labels:  diff
dif
'dif' is a Linux preprocessing front end to gvimdiff/meld/kompare
Stars: ✭ 18 (-5.26%)
Mutual labels:  diff
atom-hg
Mercurial support for Atom text editor. Works on Linux, Mac OS X and Windows.
Stars: ✭ 27 (+42.11%)
Mutual labels:  diff
elixir-utilities-web
Utilties for the Developer. Regex, HTTP echo. Diffing
Stars: ✭ 36 (+89.47%)
Mutual labels:  diff
unidiff-rs
Unified diff parsing/metadata extraction library for Rust
Stars: ✭ 19 (+0%)
Mutual labels:  diff
speech-recognition-evaluation
Evaluate results from ASR/Speech-to-Text quickly
Stars: ✭ 25 (+31.58%)
Mutual labels:  diff
eslint-plugin-diff
Run ESLint on your changes only
Stars: ✭ 80 (+321.05%)
Mutual labels:  diff
TreeWalker
PHP JSON diff
Stars: ✭ 58 (+205.26%)
Mutual labels:  diff
Odin
manage model revisions with ease
Stars: ✭ 60 (+215.79%)
Mutual labels:  diff
Micro
🏎Fast diffing and type safe SwiftUI style data source for UICollectionView
Stars: ✭ 77 (+305.26%)
Mutual labels:  diff
lightline-gitdiff
Show added, deleted and modified lines (`git diff`) in your statusline or lightline
Stars: ✭ 27 (+42.11%)
Mutual labels:  diff
ecomparatio
eComparatio: text diff and support for digital edition
Stars: ✭ 21 (+10.53%)
Mutual labels:  diff
open-md-gateway
Diff协议行情网关, 支持实时行情和历史行情
Stars: ✭ 18 (-5.26%)
Mutual labels:  diff
deltaq
Fast and portable delta encoding for .NET in 100% safe, managed code.
Stars: ✭ 26 (+36.84%)
Mutual labels:  diff
visual-differ
A Node-based diffing tool to compare an array of URLs and flag differences between them
Stars: ✭ 18 (-5.26%)
Mutual labels:  diff

go-patchutils GoDoc Go Report Card

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
@@ -1,10 +1,13 @@
 80 days around the world.
-We’ll find a pot of gold
+You’ll find a pot of gold
 just sitting where the rainbow’s ending.
 
+Top Cat! The most effectual Top Cat!
+Who’s intellectual close friends get to call,
+providing it’s with dignity.
+The indisputable leader of the gang.

 Time — we’ll fight against the time,
 and we’ll fly on the white wings of the wind.
 
-80 days around the world,
-no we won’t say a word before
 the ship is really back.
@@ -2,9 +2,13 @@
 We’ll find a pot of gold
 just sitting where the rainbow’s ending.
 
+There’s a voice that keeps on calling me.
+Who’s intellectual close friends get to call,
+providing it’s with dignity.
+The indisputable leader of the gang.

 Time — we’ll fight against the time,
 and we’ll fly on the white wings of the wind.
 
-80 days around the world,
 no we won’t say a word before
 the ship is really back.
result
@@ -1,8 +1,8 @@
 80 days around the world.
+We’ll find a pot of gold
-You’ll find a pot of gold
 just sitting where the rainbow’s ending.
 
-Top Cat! The most effectual Top Cat!
+There’s a voice that keeps on calling me.
 Who’s intellectual close friends get to call,
 providing it’s with dignity.
 The indisputable leader of the gang.
 
 Time — we’ll fight against the time,
 and we’ll fly on the white wings of the wind.
 
+no we won’t say a word before
 the ship is really back.

Mixed mode

MixedMode computes the diff of an oldSource patched with oldDiff and newSource patched with newDiff.

Example
oldSource newSource
80 days around the world.
You’ll find a pot of gold
just sitting where the rainbow’s ending.

Top Cat! The most effectual Top Cat!
Who’s intellectual close friends get to call,
providing it’s with dignity.
The indisputable leader of the gang.

Time — we’ll fight against the time,
and we’ll fly on the white wings of the wind.

the ship is really back.
80 days around the world.
We’ll find a pot of gold
just sitting where the rainbow’s ending.

There’s a voice that keeps on calling me.
Who’s intellectual close friends get to call,
providing it’s with dignity.
The indisputable leader of the gang.

Time — we’ll fight against the time,
and we’ll fly on the white wings of the wind.

no we won’t say a word before
the ship is really back.
oldDiff newDiff
@@ -4,6 +4,7 @@
 
 Top Cat! The most effectual Top Cat!
 Who’s intellectual close friends get to call,
+Round, round, all around the world.
 providing it’s with dignity.
 The indisputable leader of the gang.
@@ -5,7 +5,6 @@
 There’s a voice that keeps on calling me.
 Who’s intellectual close friends get to call,
 providing it’s with dignity.
-The indisputable leader of the gang.
 
 Time — we’ll fight against the time,
 and we’ll fly on the white wings of the wind.
oldSource + oldDiff newSource + newDiff
80 days around the world.
You’ll find a pot of gold
just sitting where the rainbow’s ending.

Top Cat! The most effectual Top Cat!
Who’s intellectual close friends get to call,
Round, round, all around the world.
providing it’s with dignity.
The indisputable leader of the gang.

Time — we’ll fight against the time,
and we’ll fly on the white wings of the wind.

the ship is really back.
80 days around the world.
We’ll find a pot of gold
just sitting where the rainbow’s ending.

There’s a voice that keeps on calling me.
Who’s intellectual close friends get to call,
providing it’s with dignity.

Time — we’ll fight against the time,
and we’ll fly on the white wings of the wind.

no we won’t say a word before
the ship is really back.
result
@@ -1,14 +1,13 @@
 80 days around the world.
-You’ll find a pot of gold
+We’ll find a pot of gold
 just sitting where the rainbow’s ending.
 
-Top Cat! The most effectual Top Cat!
+There’s a voice that keeps on calling me.
 Who’s intellectual close friends get to call,
-Round, round, all around the world.
 providing it’s with dignity.
-The indisputable leader of the gang.
 
 Time — we’ll fight against the time,
 and we’ll fly on the white wings of the wind.
 
+no we won’t say a word before
 the ship is really back.

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>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].