All Projects → octavore → Delta

octavore / Delta

Licence: mit
Delta is a command-line diff tool implemented in Go.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Delta

Diff2html Cli
Pretty diff to html javascript cli (diff2html-cli)
Stars: ✭ 287 (+61.24%)
Mutual labels:  cli, diff
Sad
CLI search and replace | Space Age seD
Stars: ✭ 350 (+96.63%)
Mutual labels:  cli, diff
Jaydiff
A JSON diff utility
Stars: ✭ 84 (-52.81%)
Mutual labels:  cli, diff
Script Progress
Estimate script execution time
Stars: ✭ 175 (-1.69%)
Mutual labels:  cli
Evans
Evans: more expressive universal gRPC client
Stars: ✭ 2,710 (+1422.47%)
Mutual labels:  cli
Redis Rdb Cli
Redis rdb CLI : A CLI tool that can parse, filter, split, merge rdb and analyze memory usage offline. It can also sync 2 redis data and allow user define there own sink service to migrate redis data to somewhere.
Stars: ✭ 176 (-1.12%)
Mutual labels:  cli
Magicli
Automagically generates command-line interfaces (CLI) for any module. Expected options and help sections are created automatically based on parameters names, with support to async.
Stars: ✭ 178 (+0%)
Mutual labels:  cli
Nbash
观看NBA比分直播,球员数据的命令行程序。
Stars: ✭ 176 (-1.12%)
Mutual labels:  cli
Aws Cost Saver
A tiny CLI tool to help save costs in development environments when you're asleep and don't need them!
Stars: ✭ 178 (+0%)
Mutual labels:  cli
Wrangler
🤠 wrangle your Cloudflare Workers
Stars: ✭ 2,632 (+1378.65%)
Mutual labels:  cli
Pubs
Your bibliography on the command line
Stars: ✭ 176 (-1.12%)
Mutual labels:  cli
Github Release
Simple Github release command line tool
Stars: ✭ 175 (-1.69%)
Mutual labels:  cli
Youtubeshop
Youtube autolike and autosubs script
Stars: ✭ 177 (-0.56%)
Mutual labels:  cli
Live Stream Radio
24/7 live stream video radio station CLI / API 📹 📻
Stars: ✭ 175 (-1.69%)
Mutual labels:  cli
Gotube
A very simple command line tool for downloading YouTube videos.
Stars: ✭ 179 (+0.56%)
Mutual labels:  cli
Fhirbase
Your persistence layer for FHIR data
Stars: ✭ 175 (-1.69%)
Mutual labels:  cli
Droot
The super-simple chroot-based application container engine.
Stars: ✭ 177 (-0.56%)
Mutual labels:  cli
Prtgapi
C#/PowerShell interface for PRTG Network Monitor
Stars: ✭ 175 (-1.69%)
Mutual labels:  cli
Mellplayer
A tiny terminal player based on Python3
Stars: ✭ 176 (-1.12%)
Mutual labels:  cli
You Dont Need Gui
Stop relying on GUI; CLI **ROCKS**
Stars: ✭ 4,766 (+2577.53%)
Mutual labels:  cli

Delta

Delta is both a Go library and a command-line utility for text diffs. Diffs can be displayed in the browser, or in command-line using the --cli flag.

Installation

brew install octavore/tools/delta

Description

Delta implements two diff functions: Smith-Waterman, and histogram diff.

Smith-Waterman is a dynamic programming algorithm for aligning two sequences, in this case text sequences. It originates from bioinformatics, where it is used for aligning DNA sequences.

histogram diff is a diff algorithm first implemented in JGit and subsequently ported over to git, where it can be used with the git diff --histogram command. This implementation post processes the histogram diff in order to push down match regions as far as possible. git also post processes diffs.

Other Usage

delta --cli <fileA> <fileB>         # print text diff to stdout
delta --cli --html <fileA> <fileB>  # print html diff to stdout
delta --gist <fileA> <fileB>        # upload html diff to a gist

Configure Git

The delta binary must be on your $PATH in order for this work. The following are helpers for adding delta to your ~/.gitconfig file.

delta --install   # makes delta the default for `git difftool`
delta --uninstall # remove delta from your gitconfig

User Config

You can configure delta using a ~/.deltarc file, for example:

{
  "context": 9,
  "showEmpty": true,
  "shouldCollapse": false,
  "highlight": true,
  "unmodifiedOpacity": 0.8,
  "diffFontSize": 12
}

Options

config key key type description
context integer between 0 and 4 number of lines of context to show
showEmpty bool whether to hide empty lines
shouldCollapse bool whether to merge browser tabs
highlight bool toggles syntax highlighting
unmodifiedOpacity float opacity of unmodified lines, between 0.1 and 1
diffFontSize integer font size of the diff

Browser Support

Screenshot

Delta works best in Chrome and Safari. You will see a separate tab open for each diff file, and then the tabs will consolidate into a single tab. In Firefox, each diff will remain in separate tabs. This is because in Firefox, each file receives its own IndexedDB instance, instead of a shared instance.

Browser support relies on the following open source libraries:

Development

Compiling From Source

go get github.com/octavore/delta/delta

If $GOPATH/bin is on your $PATH, run delta -h for usage.

Regenerating Assets

You will need npm to install the necessary node packages for compiling the front-end assets.

go-bindata is used to generate the bindata.go, which allows us to embed static resources into the compiled binary.

TODO

  • make differ/histogram diff functions more consistent and add an interface.
  • more comments for godoc/golint.
  • fix race condition in update
  • favicon
  • make sidebar resizable
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].