Re: Can git log <file> follow log of its origins?

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Can git log <file> follow log of its origins?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:08

Max Pollard [off-list ref] writes:
quoted
Max Pollard writes:
quoted
I only see the log corresponding to the 2nd commit (v1.5.3.5).
That is what you are asking "git log" to show.  "git log b.txt"
means "please simplify the history by throwing away commits that
do not have changes to paths that match b.txt, and then show the
resulting log with the change pertaining to that path".  The
first commit does not change a path called b.txt (in other
words, "git show --stat HEAD^" will not give diffstat for "b.txt"),
so that commit is not shown.

$ git log --pretty=oneline --name-status -C -C
...  So -C -C is the answer, with --name-status or --stat to
actually show the result.
The real "answer" part in that example is not -C -C.  Obviously,
you would need double-C aka --find-copies-harder, because you
did not change a.txt when creating b.txt, so it is still needed.

But the essential part of the answer is "not giving b.txt as the
pathspec, so that whatever _other_ file that could have been
copied into it is still visible when the command works".

If you say "git log --name-status -C -C -- b.txt", you would be
back to square one.

Re: Can git log <file> follow log of its origins?

From: Max Pollard <hidden>
Date: 2016-06-15 22:44:08

--- Junio C Hamano wrote:
Max Pollard writes:
quoted
...  So -C -C is the answer, with --name-status or --stat to
actually show the result.
The real "answer" part in that example is not -C -C.  Obviously,
you would need double-C aka --find-copies-harder, because you
did not change a.txt when creating b.txt, so it is still needed.

But the essential part of the answer is "not giving b.txt as the
pathspec, so that whatever _other_ file that could have been
copied into it is still visible when the command works".

If you say "git log --name-status -C -C -- b.txt", you would be
back to square one.
Aha, point taken.  In this case, looks like I can do:

    $ git log -C -C --full-diff --name-status/--stat/--summary -- b.txt

as Sean has suggested to get the copy information back.  Or are you saying that
even with "--full-diff" I can lose copy information in some cases?


MP



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help