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

Re: [PATCH] git-svn: make git svn --version work again

From
EWEric Wong <normalperson@yhbt.net>
Date
Mar 5, 2010, 11:13 UTC
Message-ID
<20100305111317.GB14650@dcvr.yhbt.net>
In-Reply-To
<fb196463677f8560aa490eaa137990ab2d5d6b86.1267698128.git.git@drmicha.warpmail.net>
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.

Show 9 quoted lines
> ---
> 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
Previous: Michael J Gruber
Message 2 of 2 in “git-svn: make git svn --version work again”
  1. git-svn: make git svn --version work againMichael J Gruber, Mar 4, 2010
  2. Eric WongMar 5, 2010

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.