git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MPMax Pollard <ajaxsupremo@yahoo.com>
Date
Jan 29, 2008, 19:47 UTC
Message-ID
<146301.84241.qm@web45914.mail.sp1.yahoo.com>
In-Reply-To
<BAYC1-PASMTP0711D909B278C305D7F28AAE350@CEZ.ICE>
--- Sean wrote:
Show 26 quoted lines
> On Tue, 29 Jan 2008 09:48:05 -0800 (PST)
> Max Pollard wrote:
> 
> > I only see the log corresponding to the 2nd commit (v1.5.3.5).  Is it
> > possible to have the above command keep going and show the history of
> > a.txt?  Or at least somehow indicate that b.txt originated from a.txt?
> 
> Hi Max,
> 
> Not sure it will leave you feeling totally satisfied but the
> following command will at least show you the copy which
> occurred in that commit:
> 
> $ git log --full-diff -C --find-copies-harder --stat -- b.txt
> commit 578ecbc516e70ce7178545233192a08369a07101
> Author: xyz <x@y.z>
> Date:   Tue Jan 29 13:11:16 2008 -0500
> 
>     Copy a.txt to b.txt
> 
>  a.txt => b.txt |    0 
>  1 files changed, 0 insertions(+), 0 deletions(-)
> 
> If you had done a rename instead of a copy, then "git log --follow b.txt"
> would have done what you're looking for, but there is no corresponding option
> to follow copies.

Many thanks for that Sean. I saw all the options in the manual, but couldn't figure out how to put them together.

This is exactly the information I wanted. It appears to identify copies in both text & binary files even if contents of b.txt are modified before commit (or at least modified in ways the copy-detection logic can identify copies).

MP
      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
Previous: SeanNext: Junio C Hamano
Message 3 of 7 in “Can git log <file> follow log of its origins?”
  1. Max PollardJan 29, 2008
  2. SeanJan 29, 2008
  3. Max PollardJan 29, 2008
  4. Junio C HamanoJan 29, 2008
  5. Max PollardJan 29, 2008
  6. Junio C HamanoJan 29, 2008
  7. Max PollardJan 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.