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

Re: [PATCH] Make sure the diff machinery outputs "\ No newline ..." in english

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Sep 6, 2005, 20:05 UTC
Message-ID
<Pine.LNX.4.63.0509061534560.23242@iabervon.org>
In-Reply-To
<Pine.LNX.4.58.0509050849500.3568@evo.osdl.org>
On Mon, 5 Sep 2005, Linus Torvalds wrote:
Show 16 quoted lines
> On Mon, 5 Sep 2005, Fredrik Kuivinen wrote:
> > 
> > After a quick look through the diff source I didn't find anything
> > else. It's quite possible that I haved missed something though. Most
> > of the translated messages are related to error reporting, which I
> > guess might be nice to have in the user specified language.
> 
> Is it possible that we could integrate the "diff" algorithm into git, and 
> get rid of the dependency on an external GNU diff? It would also make the 
> portability problems go away (ie old diff's being broken).
> 
> It would also potentially speed up the normal built-in diff a lot, since
> we wouldn't have to execute a whole other program to generate a diff, just
> call a helper function the way we do for xdiff..
> 
> Unreasonable?

The algorithm actually used by GNU diff is pretty complicated, and I don't really understand the actual implementation, which evidentally has a few important refinements over the original paper.

I've written my own diff, mainly to try a different algorithm, and it seems to work, but the code isn't yet appropriate to submit. This algorithm also has the advantage that it can identify moved sections and is less interested in interleaving a removed function with a new function to provide the shortest possible diff. I expect that I could get it to work if I put in a day on it; it's mostly writing a hashtable implementation for non-NULL-terminated string-keyed hash tables.

	-Daniel
*This .sig left intentionally blank*
Previous: Linus Torvalds
Message 5 of 5 in “Make sure the diff machinery outputs "\ No newline ..." in english”
  1. Make sure the diff machinery outputs "\ No newline ..." in englishFredrik Kuivinen, Sep 4, 2005
  2. Junio C HamanoSep 4, 2005
  3. Fredrik KuivinenSep 5, 2005
  4. Linus TorvaldsSep 5, 2005
  5. Daniel BarkalowSep 6, 2005

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.