git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git svn clone -r HEAD

From
KCKa-Hing Cheung <kcheung@riverbed.com>
Date
Jul 16, 2009, 19:12 UTC
Message-ID
<1247771532.7382.115.camel@localhost>
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
Next: Eric Wong
Message 1 of 5 in “git svn clone -r HEAD”
  1. Ka-Hing CheungJul 16, 2009
  2. Eric WongJul 20, 2009
  3. git svn: fix shallow clone when upstream revision is too newEric Wong, Jul 23, 2009
  4. Eric WongJul 23, 2009
  5. Eric WongJul 23, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.