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

Re: Searching explanation of different diff algorithms

From
Ondřej Bílka <neleai@seznam.cz>
Date
Sep 25, 2013, 08:55 UTC
Message-ID
<20130925085557.GA11402@domone.kolej.mff.cuni.cz>
In-Reply-To
<201309250924.15741.thomas@koch.ro>
On Wed, Sep 25, 2013 at 09:24:15AM +0200, Thomas Koch wrote:
Show 7 quoted lines
> Is there any explanation available of the different merrits and drawbacks of 
> the diff algorithms that Git supports?
> 
> I'm not satisfied with the default diff but have enough processing power for a 
> slower algorithm that might produce diffs that better show the intention of the 
> edit.
> 

It is not just question of algorithm, even definition how should most readable diff look like is problematic, for example when large block is rewritten and one line is unchanged then you get diff like

if (x){
- foo
+ bar
} else {
- foo
+ bar
}
but it is better to create following diff as it does not break flow of code.
if (x) {
- foo
-} else {
- foo
+ bar
+} else {
+ bar
}
Previous: Thomas KochNext: Peter Oberndorfer
Message 2 of 3 in “Searching explanation of different diff algorithms”
  1. Thomas KochSep 25, 2013
  2. Ondřej BílkaSep 25, 2013
  3. Peter OberndorferSep 25, 2013

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.