From: matthew@giassa.net
To: Stefan Beller <sbeller@google.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Question: xdiff and "pretty" (human readable) diff output
Date: Wed, 22 Mar 2017 12:47:51 -0700 [thread overview]
Message-ID: <20170322194751.tpzsnnuaxgt7jyvt@darkstar> (raw)
In-Reply-To: <CAGZ79kZ+BGG6yj_rEvjDNf3gmV5KPgvOvLfH94VdPudzbGCkyA@mail.gmail.com>
* Stefan Beller <sbeller@google.com> [2017-03-22 12:43:41 -0700]:
>On Wed, Mar 22, 2017 at 12:23 PM, <matthew@giassa.net> 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
Thank you Stefan. This provides me with everything I need.
Cheers!
--
Matthew Giassa
e: matthew@giassa.net
prev parent reply other threads:[~2017-03-22 19:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 19:23 Question: xdiff and "pretty" (human readable) diff output matthew
2017-03-22 19:43 ` Stefan Beller
2017-03-22 19:47 ` matthew [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170322194751.tpzsnnuaxgt7jyvt@darkstar \
--to=matthew@giassa.net \
--cc=git@vger.kernel.org \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox