git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: JGIT: discuss: diff/patch implementation

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 10, 2008, 19:46 UTC
Message-ID
<alpine.DEB.1.00.0811102030180.30769@pacific.mpi-cbg.de>
In-Reply-To
<200811101522.13558.fg@one2team.net>
Hi,
On Mon, 10 Nov 2008, Francis Galiegue wrote:
Show 7 quoted lines
> A very nice git feature, without even going as far as merges, is the 
> cherry pick feature.
> 
> For this to be doable from within the Eclipse Git plugin, a diff/patch 
> implementation needs to be found, in a license compatible with the 
> current JGit license (3-clause BSD, as far as I can tell). Or a new 
> implementation can be rewritten from scratch, of course.

Do not forget creating efficient packs. They also need an efficient diff engine.

> I found this:
> 
> http://code.google.com/p/google-diff-match-patch
Nice.

As was pointed out already, it is more meant to work on text than I'd like to, and it also seems to have cute DWIMery for HTML.

I did not find any implementation, so I started implementing my own version of Gene Myers' algorithm, with the plan to extend it with a patience diff option.

My code so far can generate a diff between two files, but does not use O(D) space (where D is the number of differences), but O(D^2), as I did not have enough time (a conference, and traveling around the world can do that to you).

Having looked at the source code of diff-patch-match, I admit that I do not understand enough of the algorithm with so little documentation, so I will continue my fun project.

Ciao, Dscho

Previous: Francis GaliegueNext: Francis Galiegue
Message 6 of 16 in “JGIT: discuss: diff/patch implementation”
  1. Francis GaliegueNov 10, 2008
  2. Robin RosenbergNov 10, 2008
  3. Francis GaliegueNov 10, 2008
  4. Robin RosenbergNov 10, 2008
  5. Francis GaliegueNov 10, 2008
  6. Johannes SchindelinNov 10, 2008
  7. Francis GaliegueNov 10, 2008
  8. Junio C HamanoNov 10, 2008
  9. Shawn O. PearceNov 10, 2008
  10. Francis GaliegueNov 10, 2008
  11. Johannes SchindelinNov 10, 2008
  12. Raimund BauerNov 11, 2008
  13. Shawn O. PearceNov 11, 2008
  14. Sverre RabbelierNov 11, 2008
  15. Rogan DawesNov 11, 2008
  16. Shawn O. PearceNov 11, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.