All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-svn: make git svn --version work again
@ 2010-03-04 10:23 Michael J Gruber
  2010-03-05 11:13 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Michael J Gruber @ 2010-03-04 10:23 UTC (permalink / raw)
  To: git; +Cc: Eric Wong, Junio C Hamano

by requesting SVN::Core which is needed for the svn version.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
In fact, there are a few more places where seemingly a req_svn() is missing.
But the call chains are very confusing. The one seemingly missing in prop_walk()
would be covered by the recursive props test which succeeds, so the caller
must have requested SVN::Core also. I believe this applies to the other places
as well (but not to version()).

Is there any harm done by inserting a superfluous req_svn() in these cases for
good measure?

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

diff --git a/git-svn.perl b/git-svn.perl
index bae7231..1ffb44c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -351,6 +351,7 @@ information.
 }
 
 sub version {
+	::_req_svn();
 	print "git-svn version $VERSION (svn $SVN::Core::VERSION)\n";
 	exit 0;
 }
-- 
1.7.0.1.300.gd855a

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

* Re: [PATCH] git-svn: make git svn --version work again
  2010-03-04 10:23 [PATCH] git-svn: make git svn --version work again Michael J Gruber
@ 2010-03-05 11:13 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2010-03-05 11:13 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Junio C Hamano, Josh Robb

Michael J Gruber <git@drmicha.warpmail.net> wrote:
> by requesting SVN::Core which is needed for the svn version.
> 
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>

Thanks Michael, pushed out to git://git.bogomips.org/git-svn along with the
crlf fixes by Erik.

> ---
> In fact, there are a few more places where seemingly a req_svn() is missing.
> But the call chains are very confusing. The one seemingly missing in prop_walk()
> would be covered by the recursive props test which succeeds, so the caller
> must have requested SVN::Core also. I believe this applies to the other places
> as well (but not to version()).
> 
> Is there any harm done by inserting a superfluous req_svn() in these cases for
> good measure?

There should be no harm anywhere SVN::* is needed, Perl won't attempt to
re-require something that's already required.

The primary benefactor of having an explicit req_svn() function is the
no-op case of rebase on certain setups:

commit d32fad2b89c81ca29128722e0e2f5985426e5e7a
Author: josh robb <josh_robb@fastmail.fm>
Date:   Wed Feb 24 16:13:50 2010 +1300

    git svn: delay importing SVN::Base until it is needed
    
    Importing functions from a .dll into Git for Windows' perl is pretty slow,
    so let's avoid importing if it is not necessary.
    
    This seems particularly slow in virtualized enviroments. Before this
    change (on my machine):
    
    $ time perl /libexec/git-core/git-svn rebase
    Current branch master is up to date.
    
    real 2m56.750s
    user 0m3.129s
    sys 2m39.232s
    
    Afterwards:
    
    $ time perl /libexec/git-core/git-svn rebase
    Current branch master is up to date.
    
    real 0m33.407s
    user 0m1.409s
    sys 0m23.054s
    
    git svn rebase -n goes from 3m7.046s to 0m10.312s.
    
    Signed-off-by: Josh Robb <josh_robb@fastmail.fm>
    Acked-by: Eric Wong <normalperson@yhbt.net>

-- 
Eric Wong

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

end of thread, other threads:[~2010-03-05 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-04 10:23 [PATCH] git-svn: make git svn --version work again Michael J Gruber
2010-03-05 11:13 ` Eric Wong

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.