git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Scott Chacon <schacon@gmail.com>
Cc: git list <git@vger.kernel.org>
Subject: Re: git log --follow
Date: Wed, 3 Nov 2010 23:18:27 -0400	[thread overview]
Message-ID: <20101104031827.GA20772@sigill.intra.peff.net> (raw)
In-Reply-To: <AANLkTinEEtfxu=NbaGn=A88MrU7JCFztMzB-x3--FCdB@mail.gmail.com>

On Wed, Nov 03, 2010 at 08:00:23PM -0700, Scott Chacon wrote:

> Is there any way to get 'git log --follow' to respect the -M[num]
> option?  If I want to lower the boundary for rename detection when
> printing file history, is there any way to do that?  It doesn't seem
> to work if I just list them both.

No. But this patch would do it.

diff --git a/tree-diff.c b/tree-diff.c
index 12c9a88..378f049 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -351,6 +351,7 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
 	diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;
 	diff_opts.single_follow = opt->paths[0];
 	diff_opts.break_opt = opt->break_opt;
+	diff_opts.rename_score = opt->rename_score;
 	paths[0] = NULL;
 	diff_tree_setup_paths(paths, &diff_opts);
 	if (diff_setup_done(&diff_opts) < 0)

You can see the difference with:

  $ git log --oneline --follow --name-status \
    Documentation/technical/api-string-list.txt
  1d2f80f string_list: Fix argument order for string_list_append
  M       Documentation/technical/api-string-list.txt
  e242148 string-list: add unsorted_string_list_lookup()
  M       Documentation/technical/api-string-list.txt
  0dda1d1 Fix two leftovers from path_list->string_list
  M       Documentation/technical/api-string-list.txt
  c455c87 Rename path_list to string_list
  A       Documentation/technical/api-string-list.txt

  $ git log -M40 --oneline --follow --name-status \
    Documentation/technical/api-string-list.txt
  1d2f80f string_list: Fix argument order for string_list_append
  M       Documentation/technical/api-string-list.txt
  e242148 string-list: add unsorted_string_list_lookup()
  M       Documentation/technical/api-string-list.txt
  0dda1d1 Fix two leftovers from path_list->string_list
  M       Documentation/technical/api-string-list.txt
  c455c87 Rename path_list to string_list
  R047    Documentation/technical/api-path-list.txt
  Documentation/technical/api-string-list.txt
  328a475 path-list documentation: document all functions and data structures
  M       Documentation/technical/api-path-list.txt
  530e741 Start preparing the API documents.
  A       Documentation/technical/api-path-list.txt

I think it's probably something we should be doing (as you can see, we
already copy the break_opt).

-Peff

      reply	other threads:[~2010-11-04  3:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04  3:00 git log --follow Scott Chacon
2010-11-04  3:18 ` Jeff King [this message]

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=20101104031827.GA20772@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=schacon@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).