Re: Stepping through a single file's history

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

 



On 01/28/2010 05:58 PM, John Tapsell wrote:
> 2010/1/29 Ron Garret <ron@xxxxxxxxxxx>:
>> Hello,
>> 
>> Is there an easy way to step through the history of a single file?
>> To be more specific:
> ...
>> (The use case here is remembering that back in the day there was
>> some useful code in this file that I want to retrieve, but not
>> remembering exactly when it was deleted.  So I want to step back
>> through this file's history and do diffs against HEAD.)
> 
> How about simply doing:
> 
> git log -p filename
> 
> and then you can search by pressing "/"  and then typing whatever you
> remember.
> 
> John

Have you tried "git log -Sfoo filename", which finds commits that
changed the number of occurrances of string "foo" in filename?  I've
found that quite useful in digging up deleted code.

It's not as thorough as grepping "git log -p filename", but in practice
I've found it very effective.

--Pete
--
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]