From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: sverre@rabbelier.nl, "Björn Steinbrink" <B.Steinbrink@gmx.de>,
"Stephen R. van den Berg" <srb@cuci.nl>,
"Git Mailinglist" <git@vger.kernel.org>
Subject: Re: git blame not respecting --find-copies-harder ?
Date: Thu, 31 Jul 2008 00:05:22 -0700 [thread overview]
Message-ID: <7vfxpq3559.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080731064814.GA32431@sigill.intra.peff.net> (Jeff King's message of "Thu, 31 Jul 2008 02:48:15 -0400")
Jeff King <peff@peff.net> writes:
> On Wed, Jul 30, 2008 at 05:43:52PM +0200, Sverre Rabbelier wrote:
>
>> On Wed, Jul 30, 2008 at 17:01, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:
>> > git blame doesn't know --find-copies-harder, it's -C -C for blame.
>>
>> Shouldn't it have died with "don't know option --find-copies-harder" then?
>
> Unfortunately, it _does_ know --find-copies-harder, because unknown
> options get sent to the revision option parser, which chains to the diff
> option parser. So it recognizes --find-copies-harder, but just sets a
> flag that doesn't do what we expect.
>
> I'm not sure if there is a simple fix. Does blame actually need the diff
> option parsing? If not, then we might be able to pass a flag to
> parse_revision_opt that says "don't do diff options, too".
Sigh...
We can probably pick up the result revision parser parsed out of
revs.diffopt, and then tweak "opt" with it, perhaps like this.
builtin-blame.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/builtin-blame.c b/builtin-blame.c
index 8b6b09b..4ea3431 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2346,6 +2346,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
parse_done:
argc = parse_options_end(&ctx);
+ if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
+ opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
+ PICKAXE_BLAME_COPY_HARDER);
+
if (!blame_move_score)
blame_move_score = BLAME_DEFAULT_MOVE_SCORE;
if (!blame_copy_score)
next prev parent reply other threads:[~2008-07-31 7:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-30 9:39 git blame not respecting --find-copies-harder ? Stephen R. van den Berg
2008-07-30 15:01 ` Björn Steinbrink
2008-07-30 15:43 ` Sverre Rabbelier
2008-07-31 6:48 ` Jeff King
2008-07-31 7:05 ` Junio C Hamano [this message]
2008-07-31 7:21 ` Jeff King
2008-07-31 7:36 ` Junio C Hamano
2008-07-31 8:25 ` Jeff King
2008-07-31 8:35 ` Junio C Hamano
2008-07-31 9:01 ` Pierre Habouzit
2008-07-31 9:05 ` Jeff King
2008-07-31 9:06 ` Pierre Habouzit
2008-07-31 9:03 ` Jeff King
2008-07-31 9:15 ` Pierre Habouzit
2008-07-31 9:34 ` Jeff King
2008-07-31 10:22 ` Pierre Habouzit
2008-07-31 10:33 ` 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=7vfxpq3559.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=B.Steinbrink@gmx.de \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=srb@cuci.nl \
--cc=sverre@rabbelier.nl \
/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).