From: Jeff King <peff@peff.net>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] log: fix --max-count when used together with -S or -G
Date: Wed, 9 Mar 2011 16:38:27 -0500 [thread overview]
Message-ID: <20110309213824.GA4400@sigill.intra.peff.net> (raw)
In-Reply-To: <1299703935-639-1-git-send-email-Matthieu.Moy@imag.fr>
On Wed, Mar 09, 2011 at 09:52:15PM +0100, Matthieu Moy wrote:
> --max-count is implemented by counting revisions in get_revision(), but
> the -S and -G take effect later (after running diff), hence,
> --max-count=10 -Sfoo meant "examine the 10 first revisions, and out of
> them, show only those changing the occurences of foo", not "show 10
> revisions changing the occurences of foo".
>
> In case the commit isn't actually shown, cancel the decrement of
> max_count.
Hmm. Is this papering over a bigger problem, which is that we are
throwing out commits at the time of diff rather than finding out early
whether they are TREESAME?
That is, you fixed this:
git log -100 -Sfoo
but this is still broken:
git log --parents -Sfoo
in that parent rewriting doesn't happen. You can see the results with
"gitk -Sfoo" (compare to "gitk -- path", which properly shows a
simplified history).
This is also a problem with --follow. Maybe others.
One solution is to hoist the diffcore_std stuff up to rev_compare_tree,
so we get pickaxe and rename-detection at that level. But there may be
some performance implications, especially with respect to saving the
intermediate result to be used by the actual diff generation later on.
So it's definitely a much deeper topic than your small patch. Which
maybe means we should apply your patch now as a band-aid and hope for a
better solution in the long term. I dunno.
-Peff
next prev parent reply other threads:[~2011-03-09 21:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-06 21:37 BUG? git log -Sfoo --max-count=N Óscar Fuentes
2011-03-07 12:46 ` [RFC/PATCH] " Matthieu Moy
2011-03-08 19:22 ` Junio C Hamano
2011-03-09 20:52 ` [PATCH] log: fix --max-count when used together with -S or -G Matthieu Moy
2011-03-09 21:38 ` Jeff King [this message]
2011-03-09 21:49 ` Matthieu Moy
2011-03-09 22:27 ` Junio C Hamano
2011-03-10 22:39 ` Jeff King
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=20110309213824.GA4400@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).