git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: <git@vger.kernel.org>, Bo Yang <struggleyb.nku@gmail.com>
Subject: Re: [PATCH v7 0/5] git log -L, all new and shiny
Date: Thu, 14 Jun 2012 21:40:53 -0700	[thread overview]
Message-ID: <7vlijpchm2.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <cover.1339063659.git.trast@student.ethz.ch> (Thomas Rast's message of "Thu, 7 Jun 2012 12:23:24 +0200")

Thomas Rast <trast@student.ethz.ch> writes:

> I too thought it would never happen -- but then again this is still
> not ready, I'm just trying to give it some exposure.
> ...
> There's also a longer-term wishlist hinted at in the commit message of
> the main patch: the diff machinery currently makes no provisions for
> chaining its various bells and whistles.

I am not convinced that it is "diff machinery makes no provivsions"
that is the problem. Isn't it coming from the way the series limits
the output line range and reimplements its own output routine?

All the "bells and whistles" like diffstat, word coloring, etc. go
through the xdi_diff_outf() interface, so isn't it the matter of
limiting lines that this interface calls back the "bells and
whistles" callback functions with?

When you enter the diff machinery, you have the path and the line
range you are interested in of one side (lets say you are comparing
side A and B, and have line range for side A).

If you

 - add a mechanism to pass the "interesting" line range and path
   down to the callchain from xdi_diff_outf() to xdiff_outf();

 - make one of these functions filter out (i.e. not call the
   callback xdiff_emit_consume_fn) hunks that do not overlap with
   the line range you are interested in (I would presume that they
   would be a few new fields in xdemitconf_t structure); and

 - while recording the corresponding line ranges in the other side
   of the hunks that are output,

that would give you

 - output that is limited to the "interesting" input range of side A;

 - the corresponding "interesting" range in the other side of the
   comparison, so that you can update the "interesting" range to
   feed to the next diff that compares side B with something else; and

 - for whatever processing the various "bells and whistles" callers
   already implement, as all their callbacks see are the lines in
   your "interesting" range.

No?  Am I missing something?

  parent reply	other threads:[~2012-06-15  4:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 10:23 [PATCH v7 0/5] git log -L, all new and shiny Thomas Rast
2012-06-07 10:23 ` [PATCH v7 1/5] Refactor parse_loc Thomas Rast
2012-06-07 10:23 ` [PATCH v7 2/5] blame: introduce $ as "end of file" in -L syntax Thomas Rast
2012-06-07 17:23   ` Junio C Hamano
2012-06-07 17:44     ` Thomas Rast
2012-06-07 10:23 ` [PATCH v7 3/5] Export three functions from diff.c Thomas Rast
2012-06-07 17:44   ` Junio C Hamano
2012-06-07 10:23 ` [PATCH v7 4/5] Export rewrite_parents() for 'log -L' Thomas Rast
2012-06-07 10:23 ` [PATCH v7 5/5] Implement line-history search (git log -L) Thomas Rast
2012-06-07 17:42   ` Junio C Hamano
2012-06-07 17:52     ` Thomas Rast
2012-06-10  9:38   ` Zbigniew Jędrzejewski-Szmek
2012-06-15  4:40 ` Junio C Hamano [this message]
2012-06-15 13:29   ` [PATCH v7 0/5] git log -L, all new and shiny Thomas Rast
2012-06-15 15:23     ` Junio C Hamano
2012-06-16  6:01       ` Junio C Hamano
2012-06-19 10:11         ` Thomas Rast
2012-06-19 10:33           ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vlijpchm2.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=struggleyb.nku@gmail.com \
    --cc=trast@student.ethz.ch \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).