git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/5] t1404: document function test_update_rejected

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 9, 2016, 16:05 UTC
Message-ID
<xmqqa8iujqkv.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<57598F2F.9050806@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 8 quoted lines
> 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;

Previous: Michael HaggertyNext: Michael Haggerty
Message 7 of 11 in “Improve test coverage of update-ref error messages”
  1. 0/5 Improve test coverage of update-ref error messagesMichael Haggerty, Jun 7, 2016
  2. 1/5 t1404: rename file to t1404-update-ref-errors.shMichael Haggerty, Jun 7, 2016
  3. 2/5 t1404: document function test_update_rejectedMichael Haggerty, Jun 7, 2016
  4. Johannes SixtJun 7, 2016
  5. Junio C HamanoJun 7, 2016
  6. Michael HaggertyJun 9, 2016
  7. Junio C HamanoJun 9, 2016
  8. Michael HaggertyJun 10, 2016
  9. 3/5 t1404: add more tests of update-ref error handlingMichael Haggerty, Jun 7, 2016
  10. 4/5 lock_ref_for_update(): make error handling more uniformMichael Haggerty, Jun 7, 2016
  11. 5/5 lock_ref_for_update(): avoid a symref resolutionMichael Haggerty, Jun 7, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.