All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael G Schwern <schwern@pobox.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, robbat2@gentoo.org,
	bwalton@artsci.utoronto.ca, normalperson@yhbt.net,
	jrnieder@gmail.com
Subject: Re: [PATCH 1/4] Extract some utilities from git-svn to allow extracting Git::SVN.
Date: Fri, 27 Jul 2012 01:19:37 -0700	[thread overview]
Message-ID: <50124F19.1050502@pobox.com> (raw)
In-Reply-To: <7vobn13hps.fsf@alter.siamese.dyndns.org>

On 2012.7.26 10:18 PM, Junio C Hamano wrote:
>> +# Note: not certain why this is in use instead of die.  Probably because
>> +# the exit code of die is 255?  Doesn't appear to be used consistently.
>> +sub fatal (@) { print STDERR "@_\n"; exit 1 }
> 
> Very true.  Also I do not think the line-noise prototype buys us
> anything (other than making the code look mysterious to non Perl
> programmers); we are not emulating any Perl's builtin with this
> function, and I do not see a reason why we want to force list
> context to its arguments, either.  But removal of it is not part of
> this step anyway, so I wouldn't complain.

The prototype does absolutely nothing since @ is the default prototype.  But
yes, I'm doing a very rote refactoring here.


>> +sub can_compress {
>> +    return $can_compress if defined $can_compress;
>> +
>> +    return $can_compress = eval { require Compress::Zlib; } ? 1 : 0;
>> +}
> 
> The original said "eval { require Compress::Zlib; 1; }"; presumably,
> when require does succeed, the value inside is the "1;" that has to
> be at the end of Compress::Zlib, so the difference should not matter.

Yes.  In other situations where you cannot guarantee that the statement in the
eval will return true it makes sense, but here it's redundant.


-- 
Being faith-based doesn't trump reality.
	-- Bruce Sterling

  reply	other threads:[~2012-07-27  8:19 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26 23:22 Extract Git::SVN from git-svn, take 2 Michael G. Schwern
2012-07-26 23:22 ` [PATCH 1/4] Extract some utilities from git-svn to allow extracting Git::SVN Michael G. Schwern
2012-07-27  5:18   ` Junio C Hamano
2012-07-27  8:19     ` Michael G Schwern [this message]
2012-07-27 11:34     ` Eric Wong
2012-07-26 23:22 ` [PATCH 2/4] Prepare Git::SVN for extraction into its own file Michael G. Schwern
2012-07-27  5:18   ` Junio C Hamano
2012-07-27  5:23     ` Junio C Hamano
2012-07-27  8:16     ` Michael G Schwern
2012-07-27 11:53       ` Eric Wong
2012-07-26 23:22 ` [PATCH 4/4] Move initialization of Git::SVN variables into Git::SVN Michael G. Schwern
2012-07-27  5:18   ` Junio C Hamano
2012-07-27  5:38     ` Jonathan Nieder
2012-07-27  6:07       ` Junio C Hamano
2012-07-27  6:46         ` Junio C Hamano
2012-07-27  7:09           ` Junio C Hamano
2012-07-27 20:07             ` Eric Wong
2012-07-27 20:56               ` Michael G Schwern
2012-07-27 20:59                 ` Eric Wong
2012-07-27 21:31                 ` Junio C Hamano
2012-07-27 21:49               ` Junio C Hamano
2012-07-27 22:07                 ` Eric Wong
2012-07-27 22:19                   ` Eric Wong
2012-07-27 22:37                     ` Junio C Hamano
2012-07-27 22:45                       ` Eric Wong
2012-07-27 22:59                         ` Junio C Hamano
2012-07-27 23:01                           ` Eric Wong
2012-07-27 22:52                     ` Junio C Hamano
2012-07-27 11:59         ` Eric Wong
2012-07-27  8:41     ` Michael G Schwern
  -- strict thread matches above, loose matches on Subject: below --
2012-07-25  6:01 Move Git::SVN into its own .pm file Michael G. Schwern
2012-07-25  6:01 ` [PATCH 1/4] Extract some utilities from git-svn to allow extracting Git::SVN Michael G. Schwern
2012-07-25 21:24   ` Eric Wong
2012-07-25 22:39     ` Michael G Schwern
2012-07-25 23:08       ` Eric Wong
2012-07-26  0:01         ` Michael G Schwern
2012-07-26  0:25           ` Eric Wong
2012-07-26  0:26           ` Jonathan Nieder

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=50124F19.1050502@pobox.com \
    --to=schwern@pobox.com \
    --cc=bwalton@artsci.utoronto.ca \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=normalperson@yhbt.net \
    --cc=robbat2@gentoo.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.