git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git svn clone -r HEAD
@ 2009-07-16 19:12 Ka-Hing Cheung
  2009-07-20  5:55 ` Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Ka-Hing Cheung @ 2009-07-16 19:12 UTC (permalink / raw)
  To: git; +Cc: normalperson

Hi (not subscribed),

git-svn uses $ra->get_latest_revnum to find out the latest revision, but
that can be problematic, because get_latest_revnum returns the latest
revnum in the entire repository, not restricted by whatever URL you used
to construct $ra. So if you do git svn clone -r HEAD
svn://blah/blah/trunk, it won't work if the latest checkin is in one of
the branches (it will try to fetch a rev that doesn't exist in trunk,
making the clone useless).

This change seems to work, sorry it's not a proper diff:
@sub fetch_all {
-       my $head = $ra->get_latest_revnum;
+       my $head = undef;
+       $ra->get_log("", -1, 0, 1, 0, 1, sub { $head = $_[1] });

-khc

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-23  6:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-16 19:12 git svn clone -r HEAD Ka-Hing Cheung
2009-07-20  5:55 ` Eric Wong
2009-07-23  6:43   ` [PATCH] git svn: fix shallow clone when upstream revision is too new Eric Wong
2009-07-23  6:47     ` Eric Wong
2009-07-23  6:56       ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).