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: Fri, 15 Jun 2012 08:23:42 -0700 [thread overview]
Message-ID: <7v1ulgd2f5.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <8762as4sax.fsf@thomas.inf.ethz.ch> (Thomas Rast's message of "Fri, 15 Jun 2012 15:29:26 +0200")
Thomas Rast <trast@student.ethz.ch> writes:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> 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?
>
> Well, in a very circular logic sense, yes: I reimplement the output
> routine because that's the only way I could think of doing it right now :-)
>
> However, notice that word-diff also reimplements its own output routine,
> though it probably has a better standing since it is a different format.
Also notice that word-diff uses the same xdi_diff_outf() machinery
to grab line-oriented diff as its input (cf. fn_out_consume), and
then does its thing on it. If you limit what fn_out_consume sees,
you can have word-diff do exactly what you want, no?
> This would be the first backwards coupling between the revision-walk and
> the diff generation parts, at least that I know of.
I am not convinced if you need to have any unusual back-coupling to
begin with, by the way.
If you say "git log -p [--options] -- pathspec", the revision
machinery does filter commits that do not touch any paths that patch
pathspec with the TREESAME logic, but that does not necessarily mean
you will see _all_ the commits that are not TREESAME. If you for
example use ignore-space-change options, even the preimage and the
postimage differ at the object name level (hence not TREESAME), the
diff machinery already knows how to tell the revision machinery not
to show the log message and stuff, causing the commit to be skipped
from the output, no?
I do not know why you think you would need to do the filtering
"range comparison and union" computation more than necessary. If
the user asks "log -p", you need to do it once per parent-child pair
that is not TREESAME at the place the current code calls run_diff().
I suspect that "log -p --stat" could be improved to eliminate the
separate call to run_diffstat() by restructuring the code so that
the statistics is gathered inside run_diff(), but that is independent
of this series. If this series hooked into the level I hinted in my
earlier message, such an optimization will reduce calls to your
"range comparision and union" computation for free.
next prev parent reply other threads:[~2012-06-15 15:23 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 ` [PATCH v7 0/5] git log -L, all new and shiny Junio C Hamano
2012-06-15 13:29 ` Thomas Rast
2012-06-15 15:23 ` Junio C Hamano [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v1ulgd2f5.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.
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).