git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git log --follow
@ 2010-11-04  3:00 Scott Chacon
  2010-11-04  3:18 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Chacon @ 2010-11-04  3:00 UTC (permalink / raw)
  To: git list

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.

Thanks,
Scott

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git log --follow
  2010-11-04  3:00 git log --follow Scott Chacon
@ 2010-11-04  3:18 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2010-11-04  3:18 UTC (permalink / raw)
  To: Scott Chacon; +Cc: git list

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-04  3:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-04  3:00 git log --follow Scott Chacon
2010-11-04  3:18 ` Jeff King

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).