Found possible branch point, then "Use of uninitialized value $u in substitution/concatenation"

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Found possible branch point, then "Use of uninitialized value $u in substitution/concatenation"

Thierry Suzanne
Hi,

I am converting my SVN repository to Git.
git version 2.8.2.windows.1
Windows 8.1 Pro 64bits, running Git For Windows 32bits.

I have found this error mentioned here:
http://stackoverflow.com/questions/15387812/git-svn-found-possible-branch-point
and here:
http://stackoverflow.com/questions/3009738/what-does-this-svn2git-error-mean


v1 causes 2 errors, trunk address is wrong, I set it by mistake to
same as repository root:

C:\Windows\system32>git svn clone
https://mycompany.svn.beanstalkapp.com/myproject --no-metadata -A
c:\temp\svn_to_git_users.txt
--trunk=https://mycompany.svn.beanstalkapp.com/myproject
--tags=https://mycompany.svn.beanstalkapp.com/myproject/tags
--branches=https://mycompany.svn.beanstalkapp.com/myproject/branches
c:\code\Git_myproject

[...]
W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/MS WCSF
Contrib/src/Services
W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/RealWorldControls/References
r530 = c276e3b039d8e38759c6fb17443349732552d7a2 (refs/remotes/origin/trunk)
Found possible branch point:
https://mycompany.svn.beanstalkapp.com/myproject/trunk =>
https://mycompany.svn.beanstalkapp.com/myproject/branches/20080918_DBDEPLOY,
529
Use of uninitialized value $u in substitution (s///) at
/mingw32/share/perl5/site_perl/Git/SVN.pm line 101.
Use of uninitialized value $u in concatenation (.) or string at
/mingw32/share/perl5/site_perl/Git/SVN.pm line 101.
refs/remotes/origin/trunk:
'https://mycompany.svn.beanstalkapp.com/myproject' not found in ''
C:\Windows\system32>


v2 works: corrected the paths (and using relative instead of absolute
to make line shorter)

C:\Windows\system32>git svn clone
https://mycompany.svn.beanstalkapp.com/myproject --no-metadata -A
c:\temp\svn_to_git_users.txt --trunk=trunk --tags=tags
--branches=branches c:\code\Git_myproject

[...]
r529 = 40442d32486f4ca6f713e659b3785a446bd19de6 (refs/remotes/origin/trunk)
Found possible branch point:
https://mycompany.svn.beanstalkapp.com/myproject/trunk =>
https://mycompany.svn.beanstalkapp.com/myproject/branches/20080918_DBDEPLOY,
529
Found branch parent: (refs/remotes/origin/20080918_DBDEPLOY)
40442d32486f4ca6f713e659b3785a446bd19de6
Following parent with do_switch
Successfully followed parent
r530 = 9fefc1b3a892555e315d55c2024cdf3d3a05010f
(refs/remotes/origin/20080918_DBDEPLOY)
        A       src/database/sds.dbd
[...]


As suggested on stackoverfloow posts, I opened the config file
(C:\code\Git_myproject\.git\config) and the first version (broken) was
as follow. The fetch is probably the wrong thing comparing with v2
(branches and tags are duplicated too, some stackoverflow people say
it might also cause problems).

[svn-remote "svn"]
noMetadata = 1
url = https://mycompany.svn.beanstalkapp.com/myproject
fetch = :refs/remotes/origin/trunk
branches = branches/*:refs/remotes/origin/*
tags = tags/*:refs/remotes/origin/tags/*
branches = branches/*:refs/remotes/origin/*
tags = tags/*:refs/remotes/origin/tags/*

and the 2nd version (working) was:

[svn-remote "svn"]
noMetadata = 1
url = https://mycompany.svn.beanstalkapp.com/myproject
fetch = trunk:refs/remotes/origin/trunk
branches = branches/*:refs/remotes/origin/*
tags = tags/*:refs/remotes/origin/tags/*

Looking at svn.pm, I can see we're in find_parent_branch() which
outputs the message "Found possible branch point". It then calls
other_gs($new_url, $url, $branch_from, $r, $self->{ref_id});

which itself calls:
Git::SVN->find_by_url($new_url, $url, $branch_from);

which calls:
resolve_local_globs($u, $fetch, $globspec);

and resolve_local_globs is where the error is thrown on line 100/101:
my $u = (::cmt_metadata("$refname"))[0];
$u =~ s!^\Q$url\E(/|$)!! or die

I made a mistake in my command line for sure, so this might not be a
bug, I'm just emailing all this if someone think it could be handled
differently or a better error shown.

Thanks,
T
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: Found possible branch point, then "Use of uninitialized value $u in substitution/concatenation"

Christian Couder-2
Hi,

On Thu, May 5, 2016 at 12:43 PM, Thierry Suzanne <[hidden email]> wrote:

>
> Looking at svn.pm, I can see we're in find_parent_branch() which
> outputs the message "Found possible branch point". It then calls
> other_gs($new_url, $url, $branch_from, $r, $self->{ref_id});
>
> which itself calls:
> Git::SVN->find_by_url($new_url, $url, $branch_from);
>
> which calls:
> resolve_local_globs($u, $fetch, $globspec);
>
> and resolve_local_globs is where the error is thrown on line 100/101:
> my $u = (::cmt_metadata("$refname"))[0];
> $u =~ s!^\Q$url\E(/|$)!! or die
>
> I made a mistake in my command line for sure, so this might not be a
> bug, I'm just emailing all this if someone think it could be handled
> differently or a better error shown.

Yeah, there is a die() calls above and also one on line 101, so it
looks like $u could be checked between line 100 and line 101 and die()
could be called if it is not properly defined.

Could you send a patch to do something like that?

Thanks,
Christian.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: Found possible branch point, then "Use of uninitialized value $u in substitution/concatenation"

Thierry Suzanne
Sorry, can't help :(

On 6 May 2016 at 09:27, Christian Couder <[hidden email]> wrote:

> Hi,
>
> On Thu, May 5, 2016 at 12:43 PM, Thierry Suzanne <[hidden email]> wrote:
>>
>> Looking at svn.pm, I can see we're in find_parent_branch() which
>> outputs the message "Found possible branch point". It then calls
>> other_gs($new_url, $url, $branch_from, $r, $self->{ref_id});
>>
>> which itself calls:
>> Git::SVN->find_by_url($new_url, $url, $branch_from);
>>
>> which calls:
>> resolve_local_globs($u, $fetch, $globspec);
>>
>> and resolve_local_globs is where the error is thrown on line 100/101:
>> my $u = (::cmt_metadata("$refname"))[0];
>> $u =~ s!^\Q$url\E(/|$)!! or die
>>
>> I made a mistake in my command line for sure, so this might not be a
>> bug, I'm just emailing all this if someone think it could be handled
>> differently or a better error shown.
>
> Yeah, there is a die() calls above and also one on line 101, so it
> looks like $u could be checked between line 100 and line 101 and die()
> could be called if it is not properly defined.
>
> Could you send a patch to do something like that?
>
> Thanks,
> Christian.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: Found possible branch point, then "Use of uninitialized value $u in substitution/concatenation"

Christian Couder-2
In reply to this post by Christian Couder-2
On Fri, May 6, 2016 at 5:31 PM, Thierry Suzanne <[hidden email]> wrote:
> Sorry, can't help :(

I just sent a patch. It would be nice if you could test it to confirm
that you get a nicer error message.

Also please reply below other people's comments, as customary on this list.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: Found possible branch point, then "Use of uninitialized value $u in substitution/concatenation"

Thierry Suzanne
On 7 May 2016 at 08:07, Christian Couder <[hidden email]> wrote:
>
> On Fri, May 6, 2016 at 5:31 PM, Thierry Suzanne <[hidden email]> wrote:
> > Sorry, can't help :(
>
> I just sent a patch. It would be nice if you could test it to confirm
> that you get a nicer error message.
>
> Also please reply below other people's comments, as customary on this list.


Hi,

Amended my local svn.pm file with your 2 lines.

First time:
------------------
C:\code\myproduct\trunk>git svn clone
https://mycompany.svn.beanstalkapp.com/myproduct --no-metadata -A
c:\temp\svn_to_git_users.txt
--trunk=https://mycompany.svn.beanstalkapp.com/myproduct
--tags=https://mycompany.svn.beanstalkapp.com/myproduct/tags
--branches=https://mycompany.svn.beanstalkapp.com/myproduct/branches
c:\code\Git_TestPatch
[....]
W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/MS WCSF
Contrib/src/Extensions/Silverlight
W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/MS WCSF
Contrib/src/Services
W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/RealWorldControls/References
r530 = c276e3b039d8e38759c6fb17443349732552d7a2 (refs/remotes/origin/trunk)
Found possible branch point:
https://mycompany.svn.beanstalkapp.com/myproduct/trunk =>
https://mycompany.svn.beanstalkapp.com/myproduct/branches/20080918_DBDEPLOY,
529
Initializing parent: refs/remotes/origin/20080918_DBDEPLOY@529
W: +empty_dir: trunk/etc
W: +empty_dir: trunk/src/csharp
[...]
W: +empty_dir: trunk/test
W: +empty_dir: trunk/vendor
r5 = c71eabc20ff1f4e3fd728727470a2fa5a3802891
(refs/remotes/origin/20080918_DBDEPLOY@529)
        A       src/database/tables/IllustrationRow.tbl
        A       src/database/tables/LegalEntity.tbl
        [...]
------------------

No error!
Ctrl+C to interrupt, ran exact same command again, this time the new error:
------------------
C:\code\myproduct\trunk>git svn clone
https://mycompany.svn.beanstalkapp.com/myproduct --no-metadata -A
c:\temp\svn_to_git_users.txt
--trunk=https://mycompany.svn.beanstalkapp.com/myproduct
--tags=https://mycompany.svn.beanstalkapp.com/myproduct/tags
--branches=https://mycompany.svn.beanstalkapp.com/myproduct/branches
c:\code\Git_TestPatch
Found possible branch point:
https://mycompany.svn.beanstalkapp.com/myproduct/trunk =>
https://mycompany.svn.beanstalkapp.com/myproduct/branches/20080918_DBDEPLOY,
529
refs/remotes/origin/20080918_DBDEPLOY@529: no associated commit metadata

C:\code\myproduct\trunk>
------------------

So the repro steps are potentially different. Anyway, thanks for
taking interest and handling the error nicely.

For the error message, as a beginner end user converting svn to git,
the message "no associated commit metadata" doesn't really make me
think my command line is wrong. But I'm sure with time this message
will appear on stackoverflow with its true meaning :-)

Thanks,
T
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html