summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 04f32cf)
raw | patch | inline | side by side (parent: 04f32cf)
author | Tim Stoakes <tim@stoakes.net> | |
Sun, 10 Feb 2008 04:51:08 +0000 (15:21 +1030) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 11 Feb 2008 21:23:14 +0000 (13:23 -0800) |
This command is identical to `git blame', but it shows SVN revision
numbers instead of git commit hashes.
[ew: support "^initial commit" and minor formatting fixes]
Signed-off-by: Tim Stoakes <tim@stoakes.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
numbers instead of git commit hashes.
[ew: support "^initial commit" and minor formatting fixes]
Signed-off-by: Tim Stoakes <tim@stoakes.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-svn.txt | patch | blob | history | |
git-svn.perl | patch | blob | history |
index b1d527f74cd72a7c749f1067a91a6d2c6b6235d3..340f1be02a21495182584b0c09512a8608c1a61a 100644 (file)
+
Any other arguments are passed directly to `git log'
+'blame'::
+ Show what revision and author last modified each line of a file. This is
+ identical to `git blame', but SVN revision numbers are shown instead of git
+ commit hashes.
++
+All arguments are passed directly to `git blame'.
+
--
'find-rev'::
When given an SVN revision number of the form 'rN', returns the
diff --git a/git-svn.perl b/git-svn.perl
index 7889ccea7a8d3be84063b16d34cbe5856bc22885..05fb3582d92e05e6b95ff8f249ae2ecb9892b45b 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
"Show info about the latest SVN revision
on the current branch",
{ 'url' => \$_url, } ],
+ 'blame' => [ \&Git::SVN::Log::cmd_blame,
+ "Show what revision and author last modified each line of a file",
+ {} ],
);
my $cmd;
print commit_log_separator unless $incremental || $oneline;
}
+sub cmd_blame {
+ my $path = shift;
+
+ config_pager();
+ run_pager();
+
+ my ($fh, $ctx) = command_output_pipe('blame', @_, $path);
+ while (my $line = <$fh>) {
+ if ($line =~ /^\^?([[:xdigit:]]+)\s/) {
+ my (undef, $rev, undef) = ::cmt_metadata($1);
+ $rev = sprintf('%-10s', $rev);
+ $line =~ s/^\^?[[:xdigit:]]+(\s)/$rev$1/;
+ }
+ print $line;
+ }
+ command_close_pipe($fh, $ctx);
+}
+
package Git::SVN::Migration;
# these version numbers do NOT correspond to actual version numbers
# of git nor git-svn. They are just relative.