Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [RFC] Enable 'check for copy and renames' (-C) also when path filtering

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:37

"Marco Costalba" [off-list ref] writes:
On 8/16/06, Junio C Hamano [off-list ref] wrote:
quoted
"Marco Costalba" [off-list ref] writes:
quoted
It seems that -C option of git-diff-tree it works only if the whole
changeset is retrieved.
Correct (sort of).  Pathspec works on the input side not on the
output side.  It's been specified and worked that way from the
beginning (check the list archive to see me arguing that it
would be easier to use on the output side, and Linus vetoing
because following a single file is not that interesting and the
cost outweighs the benefit of that uninteresting case).

Always feeding the whole tree is wasteful, but if we are
interested in following a single file, we could do something
like:

 - follow that file and that file only from the recent to past;

 - notice when that file disappears -- that is the point the
   file was created.  it may have created from scratch, it may
   have been renamed or copied.

 - on that commit that creates the file, look at the whole tree
   to see if we can find an origin.

 - if we find that the file was created by renaming or copying
   another, keep following that other file from that point on.
Yes, I was thinking about something like this, Thanks for point me out
this, now I am quite sure it's the correct way to go ;-)
You may want to talk with Fredrik about this.  The above is not
entirely my making but was an outline brought up while we
discussed his "rename following revision walker" on the list
recently. 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help