From: Jakub Narebski <jnareb@gmail.com>
To: "Rhodes, Kate" <masukomi@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: looking for example of following code across files
Date: Sat, 16 Feb 2008 01:16:56 -0800 (PST) [thread overview]
Message-ID: <m3pruxb6rh.fsf@localhost.localdomain> (raw)
In-Reply-To: <57E76010-D0F8-420C-A11D-8884832FD00D@gmail.com>
"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. I'd love to be able to
> demonstrate this to people but I'm not quite sure of the steps I'd
> need to do to accomplish this.
>
> I've gotten as far as using git ls-tree to track down the sha1 of the
> blob I want to follow, which I'm assuming is the key to making this
> happen but I'm not sure where to go from there. :(
>
> 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
Author: Junio C Hamano <junkio@cox.net> czw lut 23 07:10:24 2006
Committer: Junio C Hamano <junkio@cox.net> pi? lut 24 08:44:42 2006
Original File: rev-list.c
rev-list --objects: use full pathname to help hashing.
This helps to group the same files from different revs together,
while spreading files with the same basename in different
directories, to help pack-object.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This is the commit that moved the code
commit ae563542bf10fa8c33abd2a354e4b28aca4264d7
Author: Linus Torvalds <torvalds@osdl.org> nie lut 26 01:19:46 2006
Committer: Junio C Hamano <junkio@cox.net> pon lut 27 00:33:27 2006
First cut at libifying revlist generation
This really just splits things up partially, and creates the
interface to set things up by parsing the command line.
No real code changes so far, although the parsing of filenames is a bit
stricter. In particular, if there is a "--", then we do not accept any
filenames before it, and if there isn't any "--", then we check that _all_
paths listed are valid, not just the first one.
The new argument parsing automatically also gives us "--default" and
"--not" handling as in git-rev-parse.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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...
--
Jakub Narebski
Poland
ShadeHawk on #git
next prev parent reply other threads:[~2008-02-16 9:18 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 [this message]
2008-02-16 17:10 ` Rhodes, Kate
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=m3pruxb6rh.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=masukomi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.