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

Question: xdiff and "pretty" (human readable) diff output

From
Mmatthew@giassa.net <matthew@giassa.net>
Date
Mar 22, 2017, 19:23 UTC
Message-ID
<20170322192340.elg2gpvcshhk3jq3@darkstar>
Good day,

I have a question with respect to how git generates "pretty" (ie: human readable) unified diffs. It's to my understanding that git uses its own (simplified/minimized) fork of libxdiff, simply referred to as "xdiff" [1]. Which tool/library is used to take the xdiff output and generate the human-readable equivalent that is rendered to the console? I have a program that I'm maintaining that currently tracks changes to a couple of "sandboxed" files, and I wanted to add a simple console UI that periodically shows the changes to the files over time and/or dumps the "pretty diff" to syslog.

Thank you.
1. "Use a *real* built-in diff generator · git/git@3443546",
   <https://github.com/git/git/commit/3443546f6ef57fe28ea5cca232df8e400bfc3883>,
   Accessed 2017-03-22
--Matthew
Next: Stefan Beller
Message 1 of 3 in “Question: xdiff and "pretty" (human readable) diff output”
  1. matthew@giassa.netMar 22, 2017
  2. Stefan BellerMar 22, 2017
  3. matthew@giassa.netMar 22, 2017

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.