Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Use of uninitialized value $u" #50

Open
mickaelistria opened this issue Feb 2, 2012 · 19 comments
Open

"Use of uninitialized value $u" #50

mickaelistria opened this issue Feb 2, 2012 · 19 comments

Comments

@mickaelistria
Copy link

@mickaelistria mickaelistria commented Feb 2, 2012

Hi,

While giving a try to svn2git on my local machine for JBoss Tools repo - which is quite huge, I got the following error, that I don't understand:

$ /var/lib/gems/1.8/bin/svn2git -v http://anonsvn.jboss.org/repos/jbosstools
Running command: git svn init --prefix=svn/ --no-metadata --trunk=trunk --tags=tags --branches=branches http://anonsvn.jboss.org/repos/jbosstools
Running command: git svn fetch
Found possible branch point: http://anonsvn.jboss.org/repos/jbosstools/trunk => http://anonsvn.jboss.org/repos/jbosstools/branches/jboss, 78
Use of uninitialized value $u in substitution (s///) at /usr/lib/git-core/git-svn line 1728.
Use of uninitialized value $u in concatenation (.) or string at /usr/lib/git-core/git-svn line 1728.
refs/remotes/svn/trunk: 'http://anonsvn.jboss.org/repos/jbosstools' not found in ''

The first time I run this command, I could see the files being fetched. Now I don't see the fetch occur (probably files are cached), but I always get this issue.

Could someone help me on this?

@nirvdrum

This comment has been minimized.

Copy link
Owner

@nirvdrum nirvdrum commented Feb 2, 2012

It looks like that error is coming from git-svn. svn2git ultimately wraps around git-svn, which is some perl script shipped with git proper. Off-hand I'm not sure what that error is related to.

@mickaelistria

This comment has been minimized.

Copy link
Author

@mickaelistria mickaelistria commented Feb 2, 2012

Thanks, I'll ask git-svn folks.

On Thu, Feb 2, 2012 at 5:31 PM, Kevin Menard <
reply@reply.github.com

wrote:

It looks like that error is coming from git-svn. svn2git ultimately wraps
around git-svn, which is some perl script shipped with git proper.
Off-hand I'm not sure what that error is related to.


Reply to this email directly or view it on GitHub:
#50 (comment)

@marcjay

This comment has been minimized.

Copy link

@marcjay marcjay commented Feb 11, 2012

Updating to the latest version of git (from 1.7.5.4 to 1.7.8.4) solved this issue for me.

@ctapmex

This comment has been minimized.

@jean

This comment has been minimized.

Copy link

@jean jean commented Jul 2, 2012

Madden's hack, referenced by @ctapmex, worked for me when importing https://svn.plone.org/svn/collective/buildout/collective.recipe.supervisor/
svn2git (2.2.1)

@plentz

This comment has been minimized.

Copy link

@plentz plentz commented Aug 2, 2012

@ctapmex tip did the trick. thanks!

@abdul

This comment has been minimized.

Copy link

@abdul abdul commented Feb 5, 2013

@ctapmex, it works for me. thanks.

@developdaly

This comment has been minimized.

Copy link

@developdaly developdaly commented Feb 9, 2013

@ctapmex worked for me as well!

@duncanj

This comment has been minimized.

Copy link

@duncanj duncanj commented Mar 1, 2013

@ctapmex and for me too, thanks! Google groups link changed to https://groups.google.com/forum/?fromgroups=#!topic/msysgit/7MQVwRO-2N4

@mateor

This comment has been minimized.

Copy link

@mateor mateor commented Mar 1, 2013

Worked for me as well, exact same failure but at line 106 in /usr/share/perl5/Git/SVN.pm

@anselmdk

This comment has been minimized.

Copy link

@anselmdk anselmdk commented Mar 11, 2013

Seems to work for me as well, at least it doesn't die.
This is what needs to be done (though it feels a bit edgy editing git core files...):

Hey guys, I thought maybe I'd have a look at that line 2097 and see if there was anything I could do about it myself. I was able to determine that, in this specific case, the variable $u was not defined (or something). So, without knowing much about what's actually going on there, I changed this: 

$u =~ s!^\Q$url\E(/|$)!! or die 
        "$refname: '$url' not found in '$u'\n"; 

to this: 

if(!$u) { 
        $u = $pathname; 
}else { 
        $u =~ s!^\Q$url\E(/|$)!! or die 
        "$refname: '$url' not found in '$u'\n"; 
} 

and then just hoped for the best. So far it seems to be working. I'm getting some "Couldn't fine revmap" messages but I don't know if that's something I should be concerned about. Anyway, I don't know if this is a proper solution but I hope will help in some way. 
@if6was9

This comment has been minimized.

Copy link

@if6was9 if6was9 commented May 20, 2013

@mateor I ran into this as well.

@anselmdk thanks for the fix

Like you, I'm not sure whether this is the most appropriate fix to the underlying root cause or not.

I created a fork of git and applied this patch to support some conversions I am doing. I applied the fix to 1.8.2.3 and master.

https://github.com/if6was9/git/commit/364c42061ade26469f47980bf768d625099b866a

I'm going to submit to the patch to the git mailing list and see what they say.

@jaolho

This comment has been minimized.

Copy link

@jaolho jaolho commented Jul 24, 2013

Editing the config file worked for me: http://stackoverflow.com/a/17827367/2613458

@chung-leong

This comment has been minimized.

Copy link

@chung-leong chung-leong commented Apr 30, 2014

In my case, editing the config file makes it work for a bit, then it fails again. The fix posted by anelmdk allows the process to go the whole way.

@boxerab

This comment has been minimized.

Copy link

@boxerab boxerab commented Nov 3, 2014

+1 for anselmdk 's fix

@leeplay

This comment has been minimized.

Copy link

@leeplay leeplay commented Nov 17, 2014

+1 for anselmdk 's fix :)

@archibaldovitch

This comment has been minimized.

Copy link

@archibaldovitch archibaldovitch commented Nov 18, 2014

Why can't this fix make its way upstream ?

@amedee

This comment has been minimized.

Copy link

@amedee amedee commented Dec 18, 2014

@mickaelistria what was the result of you contacting the git-svn people? Who did you contact?

The fix proposed by @anselmdk does not work for me, because I have the error at line 106, see #99

@archibaldovitch I think the reason is because upstream has not been contacted yet, and/or nobody knows who to contact at upstream, and how. Maybe?

@tbowden

This comment has been minimized.

Copy link

@tbowden tbowden commented Feb 14, 2018

As I reported here: #66 (comment)

Fix for me was making sure I was running svn2git in a genuinely empty directory ("rm -rf .git") if a previous attempt had aborted for some other reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.