author | Junio C Hamano <gitster@pobox.com> | |
Thu, 3 Apr 2008 05:17:53 +0000 (22:17 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 13 Apr 2008 02:41:29 +0000 (19:41 -0700) | ||
commit | 85af7929ee125385c2771fa4eaccfa2f29dc63c9 | |
tree | 21eac886cc62c03d874688e1ce0ecba44d4ce49c | tree | snapshot |
parent | 69264f46a193ae9dec5761984b4bae32f4810916 | commit | diff |
git-blame --reverse
This new option allows "git blame" to read an old version of the file, and
up to which commit each line survived (i.e. their children rewrote the
line out of the contents). The previous revision machinery update to
decorate each commit with its children was leading to this change. When
the --reverse option is given, we read the old version and pass blame to
the children of the current suspect, instead of the usual order of
starting from the latest and passing blame to parents.
The standard yardstick of "blame" in git.git history is "rev-list.c" which
was refactored heavily in its existence. For example:
git blame -C -C -w --reverse 9de48752..master -- rev-list.c
begins like this:
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 1) #include "cache...
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 2) #include "commi...
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 3) #include "tree....
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 4) #include "blob....
213523f4 rev-list.c (JC Hamano 2006-03-01 5) #include "epoch...
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 6)
ab57c8dd rev-list.c (JC Hamano 2006-02-24 7) #define SEEN
ab57c8dd rev-list.c (JC Hamano 2006-02-24 8) #define INTERES...
213523f4 rev-list.c (JC Hamano 2006-03-01 9) #define COUNTED...
7e21c29b rev-list.c (LTorvalds 2005-07-06 10) #define SHOWN ...
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 11)
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 12) static const ch...
b1349229 rev-list.c (LTorvalds 2005-07-26 13) "usage: git-...
This reveals that the original first four lines survived until now in
builtin-rev-list.c , inclusion of "epoch.h" was removed after 213523f4
while the contents was still in rev-list.c.
This mode probably needs more tweaking so that the commit that removed the
line (i.e. the children of the commits listed in the above sample output)
is shown instead to be useful, but then there is a little matter of which
child of a fork point to show.
For now, you can find the diff that rewrote the fifth line above by doing:
$ git log --children 213523f4^..
to find its child, which is 1025fe5 (Merge branch 'lt/rev-list' into next,
2006-03-01), and then look at that child with:
$ git show 1025fe5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This new option allows "git blame" to read an old version of the file, and
up to which commit each line survived (i.e. their children rewrote the
line out of the contents). The previous revision machinery update to
decorate each commit with its children was leading to this change. When
the --reverse option is given, we read the old version and pass blame to
the children of the current suspect, instead of the usual order of
starting from the latest and passing blame to parents.
The standard yardstick of "blame" in git.git history is "rev-list.c" which
was refactored heavily in its existence. For example:
git blame -C -C -w --reverse 9de48752..master -- rev-list.c
begins like this:
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 1) #include "cache...
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 2) #include "commi...
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 3) #include "tree....
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 4) #include "blob....
213523f4 rev-list.c (JC Hamano 2006-03-01 5) #include "epoch...
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 6)
ab57c8dd rev-list.c (JC Hamano 2006-02-24 7) #define SEEN
ab57c8dd rev-list.c (JC Hamano 2006-02-24 8) #define INTERES...
213523f4 rev-list.c (JC Hamano 2006-03-01 9) #define COUNTED...
7e21c29b rev-list.c (LTorvalds 2005-07-06 10) #define SHOWN ...
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 11)
6c41b801 builtin-rev-list.c (JC Hamano 2008-04-02 12) static const ch...
b1349229 rev-list.c (LTorvalds 2005-07-26 13) "usage: git-...
This reveals that the original first four lines survived until now in
builtin-rev-list.c , inclusion of "epoch.h" was removed after 213523f4
while the contents was still in rev-list.c.
This mode probably needs more tweaking so that the commit that removed the
line (i.e. the children of the commits listed in the above sample output)
is shown instead to be useful, but then there is a little matter of which
child of a fork point to show.
For now, you can find the diff that rewrote the fifth line above by doing:
$ git log --children 213523f4^..
to find its child, which is 1025fe5 (Merge branch 'lt/rev-list' into next,
2006-03-01), and then look at that child with:
$ git show 1025fe5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-blame.c | diff | blob | history |