Git development
 help / color / mirror / Atom feed
From: "Rhodes, Kate" <masukomi@gmail.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: looking for example of following code across files
Date: Sat, 16 Feb 2008 12:10:11 -0500	[thread overview]
Message-ID: <44F74AD0-CD8E-4715-BA88-4355F4513AB0@gmail.com> (raw)
In-Reply-To: <m3pruxb6rh.fsf@localhost.localdomain>


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

> "Rhodes, Kate" <masukomi@gmail.com> 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

  reply	other threads:[~2008-02-16 17:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-16  4:41 looking for example of following code across files Rhodes, Kate
2008-02-16  9:16 ` Jakub Narebski
2008-02-16 17:10   ` Rhodes, Kate [this message]
2008-02-16 17:54     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44F74AD0-CD8E-4715-BA88-4355F4513AB0@gmail.com \
    --to=masukomi@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox