Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can i find the histogram diff algorithm on internet?

Where can i find the histogram diff algorithm on internet. I want to compare two texts and find the differences, currently i am trying the patience diff algorithm,but that does not work that effective, i have heard like histogram diff algorithm is an improved version of patience diff

like image 485
Alex Joy Avatar asked Feb 16 '26 07:02

Alex Joy


1 Answers

The git software implements both patience and histogram diff algorithms. See also: What's the difference between `git diff --patience` and `git diff --histogram`?

If you have git installed, the commands are:

git diff --histogram
git diff --patience

Your question has the javascript tag. I assume you are looking for a library, or a description of the algorithm so you can implement it yourself. The library used by git is libxdiff. Another diff library is xdelta.

Links:

  • Libxdiff http://www.xmailserver.org/xdiff-lib.html https://formulae.brew.sh/formula/libxdiff
  • XDelta http://xdelta.org/ https://github.com/jmacd/xdelta
like image 54
Stef Avatar answered Feb 17 '26 20:02

Stef