git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dennis Schridde <devurandom@gmx.net>
Cc: Eric Wong <normalperson@yhbt.net>, git@vger.kernel.org
Subject: Re: Odd number of elements in anonymous hash
Date: Thu, 10 Jan 2008 13:45:50 -0800	[thread overview]
Message-ID: <7vmyrd5p81.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <200801102213.04082.devurandom@gmx.net> (Dennis Schridde's message of "Thu, 10 Jan 2008 22:13:00 +0100")

Dennis Schridde <devurandom@gmx.net> writes:

> Am Donnerstag, 10. Januar 2008 21:08:52 schrieb Junio C Hamano:
>> Dennis Schridde <devurandom@gmx.net> writes:
>> >> [svn-remote "svn"]
>> >>     reposRoot = file:///var/svn/warzone2100
>> >>     uuid = 4a71c877-e1ca-e34f-864e-861f7616d084
>> >>     branches-maxRev = 14
>> >>     tags-maxRev = 14
>> >>     svnsync-uuid = 4a71c877-e1ca-e34f-864e-861f7616d084\n
>> >>     svnsync-url = http://svn.gna.org/svn/warzone
>> >> [svn-remote "tags/1.10a.12"]
>> >>     reposRoot = file:///var/svn/warzone2100
>> >>     uuid = 4a71c877-e1ca-e34f-864e-861f7616d084
>> >> ---
>> >
>> > The rest of the file is rather boring. The "svn" remote is not changed
>> > (besides having higher revisions) and the other remotes look exactly like
>> > the "tags/1.10a.12" one.
>> >
>> > Somehow I think that the \n at the end of the svnsync-uuid shouldn't be
>> > there... It could be that this is the same linebreak which prevents
>> > people from relocating (svn switch --relocate) from
>> > svn://svn.gna.org/svn/warzone to http://svn.gna.org/svn/warzone, so that
>> > would be a Gna bug.
>> > However git-svn shouldn't throw any warnings (or even (make perl) crash?)
>> > on such occasions, either...
>> >
>> > I now got it to run through without a segfault, by compiling an unstriped
>> > perl binary with debug symbols (Gentoo: FEATURES=nostrip CFLAGS="...
>> > -g"). Maybe this is a bug in GCC or something...
>> >
>> > The "Odd number of elements in anonymous hash" still stays, though.
>>
>> The code in question is:
>>
>> 	my $svnsync;
>> 	# see if we have it in our config, first:
>> 	eval {
>> 		my $section = "svn-remote.$self->{repo_id}";
>> 		$svnsync = {
>> 		  url => tmp_config('--get', "$section.svnsync-url"),
>> 		  uuid => tmp_config('--get', "$section.svnsync-uuid"),
>> 		}
>> 	};
>>
>> I think the "Odd number" is an indication that one of the
>> tmp_config() calls is returning an even number of elements (so
>> the hash whose ref will be stored in $svnsync ends up having an
>> odd number of elements), and that is why I initially asked you
>> about "more than one" svnsync-url.  0 is also an even number,
>> and it could be that it is not finding any.
>>
>> How about doing something ugly like this _just for diagnosis_?
>>
>> 	my $svnsync;
>> 	# see if we have it in our config, first:
>> 	eval {
>> 		my $section = "svn-remote.$self->{repo_id}";
>> 		my @u = tmp_config('--get', "$section.svnsync-url");
>> 		my @v = tmp_config('--get', "$section.svnsync-uuid");
>> 		if (@u != 1 || @v != 1) {
>>                 	print STDERR "Oops: <$section> $#u <@u> $#v <@v>\n";
>> 		}
>> 		$svnsync = {
>> 		  url => @u,
>> 		  uuid => @v,
>> 		}
>> 	};
> I've created /usr/bin/git-svndbg and changed that part, like you proposed.
> I now get this output. (As it continues to run, there are probably more 
> occassions of the Oops.)
> ---
> Oops: <svn-remote.svn> 0 <http://svn.gna.org/svn/warzone> 1 
> <4a71c877-e1ca-e34f-864e-861f7616d084 >
> Odd number of elements in anonymous hash at /usr/bin/git-svndbg line 1768.
> r13 = ee6d5a48dd5cf1a96ed5217d638f372d2c173d89 (tags/1.10a)
> ---

Exactly.  The trailing newline is taken as a record separator by
tmp_config subroutine.

  reply	other threads:[~2008-01-10 21:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-08 16:38 Odd number of elements in anonymous hash Dennis Schridde
2008-01-08 17:21 ` Junio C Hamano
2008-01-08 17:30   ` Dennis Schridde
2008-01-10  8:38     ` Eric Wong
2008-01-10 11:04       ` Dennis Schridde
2008-01-10 17:13         ` Dennis Schridde
2008-01-10 20:08           ` Junio C Hamano
2008-01-10 21:13             ` Dennis Schridde
2008-01-10 21:45               ` Junio C Hamano [this message]
2008-01-12  7:13                 ` [PATCH] git-svn: handle leading/trailing whitespace from svnsync revprops Eric Wong
2008-01-12  7:57                   ` Junio C Hamano
2008-01-12  9:12                     ` Eric Wong
2008-01-12  9:55                       ` Björn Steinbrink
2008-01-12 18:57                       ` Junio C Hamano
2008-01-12 19:31                         ` Junio C Hamano
2008-01-12 12:34                   ` Dennis Schridde
2008-01-09 22:58   ` Odd number of elements in anonymous hash Eric Wong
     [not found] ` <200801240037.33908.devurandom@gmx.net>
     [not found]   ` <4797E894.8060706@vilain.net>
     [not found]     ` <200801241513.45088.devurandom@gmx.net>
2008-01-24 23:10       ` Sam Vilain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vmyrd5p81.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=devurandom@gmx.net \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).