summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ce207c7)
raw | patch | inline | side by side (parent: ce207c7)
author | Eric Wong <normalperson@yhbt.net> | |
Wed, 14 Feb 2007 01:09:40 +0000 (17:09 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:12 +0000 (00:57 -0800) |
Similar in spirit to the recent dcommit change, we now
look at 'HEAD' by default to look for a GIT_SVN_ID
so the user won't have to pass -i <GIT_SVN_ID> argument.
We are also more tolerant of of people passing bare remote names
as a result (just $GIT_SVN_ID without the -i)
Signed-off-by: Eric Wong <normalperson@yhbt.net>
look at 'HEAD' by default to look for a GIT_SVN_ID
so the user won't have to pass -i <GIT_SVN_ID> argument.
We are also more tolerant of of people passing bare remote names
as a result (just $GIT_SVN_ID without the -i)
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 66653f9eb44ad2f834ccd8d53d59540c4d662df7..fb2c864a392fa3c2c3f622ac712e8d4e0ec51868 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
}
sub git_svn_log_cmd {
- my ($r_min, $r_max) = @_;
- my $gs = Git::SVN->_new;
+ my ($r_min, $r_max, @args) = @_;
+ my $head = 'HEAD';
+ foreach my $x (@args) {
+ last if $x eq '--';
+ next unless ::verify_ref("$x^0");
+ $head = $x;
+ last;
+ }
+
+ my $url;
+ my ($fh, $ctx) = command_output_pipe('rev-list', $head);
+ while (<$fh>) {
+ chomp;
+ $url = (::cmt_metadata($_))[0];
+ last if defined $url;
+ }
+ close $fh; # break the pipe
+
+ my $gs = Git::SVN->find_by_url($url) || Git::SVN->_new;
my @cmd = (qw/log --abbrev-commit --pretty=raw --default/,
$gs->refname);
push @cmd, '-r' unless $non_recursive;
}
config_pager();
- @args = (git_svn_log_cmd($r_min, $r_max), @args);
+ @args = (git_svn_log_cmd($r_min, $r_max, @args), @args);
my $log = command_output_pipe(@args);
run_pager();
my (@k, $c, $d);