git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Jackson <ben@ben.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, normalperson@yhbt.net, Ben Jackson <ben@ben.com>
Subject: [PATCHv2 1/2] Limit start revision of find_rev_before to max existing revision
Date: Wed,  3 Jun 2009 20:45:51 -0700	[thread overview]
Message-ID: <1244087152-17002-1-git-send-email-ben@ben.com> (raw)

Signed-off-by: Ben Jackson <ben@ben.com>
---

On Wed, Jun 03, 2009 at 05:24:06PM -0700, Eric Wong wrote:
>
> find_rev_before can certainly be improved.  I haven't noticed
> performance issues with it myself, but you should be able to improve it.

This avoids a long wait if you do 'git svn reset -r 9999999'.  The
linear search within the contiguous revisions doesn't seem to be a
problem.

 git-svn.perl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 20bf828..b77710c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3130,6 +3130,8 @@ sub find_rev_before {
 	my ($self, $rev, $eq_ok, $min_rev) = @_;
 	--$rev unless $eq_ok;
 	$min_rev ||= 1;
+	my $max_rev = $self->rev_map_max;
+	$rev = $max_rev if ($rev > $max_rev);
 	while ($rev >= $min_rev) {
 		if (my $c = $self->rev_map_get($rev)) {
 			return ($rev, $c);
-- 
1.6.3.GIT

             reply	other threads:[~2009-06-04  3:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04  3:45 Ben Jackson [this message]
2009-06-04  3:45 ` [PATCHv2 2/2] Add 'git svn reset' to unwind 'git svn fetch' Ben Jackson
2009-06-04 22:38   ` 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=1244087152-17002-1-git-send-email-ben@ben.com \
    --to=ben@ben.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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 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).