All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ka-Hing Cheung <kcheung@riverbed.com>
To: git@vger.kernel.org
Cc: normalperson@yhbt.net
Subject: git svn clone -r HEAD
Date: Thu, 16 Jul 2009 12:12:12 -0700	[thread overview]
Message-ID: <1247771532.7382.115.camel@localhost> (raw)

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

             reply	other threads:[~2009-07-16 19:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16 19:12 Ka-Hing Cheung [this message]
2009-07-20  5:55 ` git svn clone -r HEAD 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1247771532.7382.115.camel@localhost \
    --to=kcheung@riverbed.com \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.