public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: merlyn@stonehenge•com (Randal L. Schwartz)
To: git@vger•kernel.org
Cc: subversion@elego•de
Subject: Re: [PATCH] Allow multiple tag and branch directories in   git-svnimport
Date: Tue, 21 Aug 2007 10:46:23 -0700	[thread overview]
Message-ID: <86wsvook5s.fsf@blue.stonehenge.com> (raw)
In-Reply-To: <20070821173838.GC1721@jack.stsp.lan> (Stefan Sperling's message of "Tue, 21 Aug 2007 19:38:38 +0200")

>>>>> "Stefan" == Stefan Sperling <stsp@elego•de> writes:

Stefan> On Tue, Aug 21, 2007 at 07:08:58PM +0200, Stefan Sperling wrote:
>> +my @tag_dirs = defined $opt_t ? split /:/,$opt_t : "tags";
Stefan>       ^                                                ^^^^^
>> +my @branch_dirs = defined $opt_b ? split /:/,$opt_b : "branches";
Stefan>       ^                                                  ^^^^^^^^^^

Stefan> Ouch, just noticed it's a bad idea to try to initialise
Stefan> an array with a scalar. Sorry :-/

That's completely normal.  Perl predictably promotes the single scalar to an
array of one element.  I wouldn't have even noticed it in a detailed code
review, since it's so normal to do that.

In fact, the parens that you added do *not* make it a list.  The parens
are purely for precedence in:

    @a = (3, 5, 7);

because otherwise, the text:

    @a = 3, 5, 7;

would be parsed as:

    (@a = 3), 5, 7;

which would be pretty pointless.  It's the *comma* in a list context that
makes it a list.

So, your parens are not only uncommon, they are also completely ineffective,
similar to replacing 2 + 3 with (2) + (3) :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge•com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

  reply	other threads:[~2007-08-21 17:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-21 17:08 [PATCH] Allow multiple tag and branch directories in git-svnimport Stefan Sperling
2007-08-21 17:38 ` Stefan Sperling
2007-08-21 17:46   ` Randal L. Schwartz [this message]
2007-08-22 10:24     ` Stefan Sperling

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=86wsvook5s.fsf@blue.stonehenge.com \
    --to=merlyn@stonehenge$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=subversion@elego$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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