Re: looking for example of following code across files

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

 




On Feb 16, 2008, at 4:16 AM, Jakub Narebski wrote:

"Rhodes, Kate" <masukomi@xxxxxxxxx> writes:

I seem to remember that when Linus was giving the tech-talk to the
folks at Google he mentioned Git being able to follow a block of code
as it was moved from file to file, but I'm having a hard time finding
an actual example of how that plays out.
[snip]

Can someone please point me to an example showing how to go about this?

For example in git.git repository, try "git gui blame revision.c".
The 9th fragment, the 'path_name' function, was moved there from the
file "rev-list.c".

This is the commit that added the code:

 commit e646de0d14bac20ef6e156c1742b9e62fb0b9020
[snip]

This is the commit that moved the code

 commit ae563542bf10fa8c33abd2a354e4b28aca4264d7
[snip]

You can check the commits using gitweb; unfortunately blame in gitweb
is usually disabled, and it dies not have fancy "git gui blame"
showing of code movements.

P.S. Sorry, I've just noticed that the dates are in my locale...

Thank you Jakub. I really appreciate it.
In order to find the original commit of each block is the system looking up the commit for each block via it's SHA1, then following its parent commits until it finds another commit that affected the same block or runs out of commits?

I'm thinking that while this would be possible to do manually it would way too many lookups to be practical. Or, is there a simpler way to do it on the command line?

I'm just trying to get my head around how the pieces of git fit together.

-Kate=masukomi


-
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