git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: "Johannes Sixt" <j6t@kdbg.org>,
	"David Turner" <dturner@twopensource.com>,
	"Jeff King" <peff@peff.net>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH 2/5] t1404: document function test_update_rejected
Date: Thu, 09 Jun 2016 09:05:04 -0700	[thread overview]
Message-ID: <xmqqa8iujqkv.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <57598F2F.9050806@alum.mit.edu> (Michael Haggerty's message of "Thu, 9 Jun 2016 17:45:51 +0200")

Michael Haggerty <mhagger@alum.mit.edu> writes:

> On 06/07/2016 06:57 PM, Johannes Sixt wrote:
>> Am 07.06.2016 um 13:50 schrieb Michael Haggerty:
>>>   test_update_rejected () {
>>> +    local prefix before pack create error &&
>> 
>> Do we want to add more of unportable 'local' declarations?
>
> Sorry, I forgot that `local` is not in the POSIX standard.

Regarding portability we say three things.

 * It is supported practically everywhere, and it is even in POSIX,
   so let's use it.

 * Even this is not in POSIX, it is supported practically
   everywhere, and it is too cumbersome to do things without using
   it, so let's use it.

 * It is not available in some platforms we (collectively) still
   care; it is not even in POSIX.  Don't use it.

I think "local" falls into the third one.

: bash; ksh
$ v=1
$ f () { local v; v=2; echo f; }
$ f
ksh: local: not found [No such file or directory]
f
$ echo $v
2
$ exit
: bash;

  reply	other threads:[~2016-06-09 16:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 11:50 [PATCH 0/5] Improve test coverage of update-ref error messages Michael Haggerty
2016-06-07 11:50 ` [PATCH 1/5] t1404: rename file to t1404-update-ref-errors.sh Michael Haggerty
2016-06-07 11:50 ` [PATCH 2/5] t1404: document function test_update_rejected Michael Haggerty
2016-06-07 16:57   ` Johannes Sixt
2016-06-07 19:25     ` Junio C Hamano
2016-06-09 15:45     ` Michael Haggerty
2016-06-09 16:05       ` Junio C Hamano [this message]
2016-06-10  6:30         ` Michael Haggerty
2016-06-07 11:50 ` [PATCH 3/5] t1404: add more tests of update-ref error handling Michael Haggerty
2016-06-07 11:50 ` [PATCH 4/5] lock_ref_for_update(): make error handling more uniform Michael Haggerty
2016-06-07 11:50 ` [PATCH 5/5] lock_ref_for_update(): avoid a symref resolution Michael Haggerty

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqa8iujqkv.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=mhagger@alum.mit.edu \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).