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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 22, 2017 at 12:23 PM,  <matthew@xxxxxxxxxx> wrote:
> 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].

correct.

> Which tool/library is used to take the xdiff output and generate
> the human-readable equivalent that is rendered to the console?

Git itself. Have a look at diff.c (it's only 5k lines of code ;)

Maybe start with fn_out_consume which is a callback (for xdiff)
that is responsible for pretty printing the output, i.e. transforming the
output of xdiff according to Gits configuration.

> 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.

> over time

So you could use cron for that?

>  "pretty diff" to syslog.

So you want to modify the "pretty diff"?
Maybe that can be archived by a custom format
(see the git *log* man page) and doesn't require hacking.

Thanks,
Stefan



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]