git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Project idea: github-like diff view
Date: Tue, 22 Apr 2014 11:59:01 -0400	[thread overview]
Message-ID: <20140422155901.GA13663@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8DnJeZ-43Ydg_j00CO6=6NOA1wdzQ+EwCX6idrUOLn8gA@mail.gmail.com>

On Tue, Apr 22, 2014 at 04:59:17PM +0700, Duy Nguyen wrote:

> On Sun, Apr 20, 2014 at 9:46 PM, Jeff King <peff@peff.net> wrote:
> > On Sun, Apr 20, 2014 at 04:58:28PM +0700, Duy Nguyen wrote:
> >
> >> - --color-words within unified diff format, using background color to
> >> show what part of the line has changed. This is only enabled for
> >> 1-line changes.
> >
> > See contrib/diff-highlight.
> 
> Thanks. I'd rather have it built in core git still. I'll try to see if
> I can rewrite it in C. Else, any objection to promote it to a core
> helper and setup pager automatically? We can have a config key to turn
> it off, but if git diff is colored, then it could be on by default.

If you are going to write it as part of git, it would be interesting to
try using a real word-diff to find the inter-line changes, instead of
the "front and back match" heuristic that the script uses. I know there
are some cases that would look better, like:

  -foo(buf, len);
  +foo(obj->buf, obj->len);

but I suspect some cases would also look worse. It would be interesting
to experiment with, though.

-Peff

  reply	other threads:[~2014-04-22 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-20  9:58 Project idea: github-like diff view Duy Nguyen
2014-04-20 14:46 ` Jeff King
2014-04-22  9:59   ` Duy Nguyen
2014-04-22 15:59     ` Jeff King [this message]
2014-04-22 16:11     ` Felipe Contreras

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=20140422155901.GA13663@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.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;
as well as URLs for NNTP newsgroup(s).