git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCHv2 1/2] Limit start revision of find_rev_before to max existing revision
@ 2009-06-04  3:45 Ben Jackson
  2009-06-04  3:45 ` [PATCHv2 2/2] Add 'git svn reset' to unwind 'git svn fetch' Ben Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Jackson @ 2009-06-04  3:45 UTC (permalink / raw)
  To: git; +Cc: gitster, normalperson, Ben Jackson

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

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

end of thread, other threads:[~2009-06-04 22:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-04  3:45 [PATCHv2 1/2] Limit start revision of find_rev_before to max existing revision Ben Jackson
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

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).