Thread (9 messages) flat view 9 messages, 6 authors, 2016-06-15

Re: git log -M -- filename is not working?

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:48:46

Eli Barzilay [off-list ref] writes:
On May  7, Eugene Sajine wrote:
quoted
On Fri, May 7, 2010 at 2:10 PM, Jacob Helwig [off-list ref] wrote:
quoted
You want the --follow flag, too.
Thanks! I missed this guy. By the way it seems that --follow flag
works without -M or -C.

Are those deprecated or I'm missing the difference between three of
them??
BTW, I've had at least 4 people now who got confused by this.  Is
there any use for -M/-C without --follow?  In any case, it will be
very helpful if the -M/-C descriptions said "see also --follow".
Yes, '-M/-C' is useful with "git diff" _without_ pathspec, including
e.g. "git show -C".

The problem with "git log -M -- <filename>" is that history simplification,
which is required for good performance, happens before diff mechanism has a
chance to perform rename detection.  Before there was '--follow' option to
git-log (which supports only the case of single file, and doesn't work that
well with more complicated history), you were forced to do

  $ git log -M -- <filename> <oldname> <oldername>...
Also, is there a way to set this as the default for `git log'?
I don't think so.  Note also that '--follow' works only with single file,
and does not work for example (currently) with directory pathspec.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help