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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 29 Jan 2008 09:48:05 -0800 (PST)
Max Pollard <ajaxsupremo@xxxxxxxxx> wrote:

> If I do the following:
> 
>      $ git init
>      $ echo "The brown fox is getting old" > a.txt
>      $ git add a.txt
>      $ git commit -m "Commit a.txt"
> 
>      $ cp a.txt b.txt
>      $ git add b.txt
>      $ git commit -m "Copy a.txt to b.txt"
> 
>      $ git log b.txt
> 
> 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@xxx>
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.

HTH,
Sean
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux