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

Re: [PATCH 1/2] t1501: avoid bashisms

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Dec 25, 2010, 14:44 UTC
Message-ID
<AANLkTi=fCa4a-POoMWqnraFjz28-Ko4Yp0fcar+d7AsE@mail.gmail.com>
In-Reply-To
<AANLkTinhrBf14446rJBZSYWTSH6sxOchMcgBsrq8DoLO@mail.gmail.com>
On Sat, Dec 25, 2010 at 9:29 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
Show 20 quoted lines
> 2010/12/25 Andreas Schwab <schwab@linux-m68k.org>:
>> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>>
>>> @@ -322,7 +322,10 @@ test_expect_success 'git grep' '
>>>  test_expect_success 'git commit' '
>>>       (
>>>               cd repo.git &&
>>> -             GIT_DIR=. GIT_WORK_TREE=work git commit -a -m done
>>
>> In which way is that not portable?
>
> I admit that I rarely leave bash, so I'll quote Johannes answer [1]
>
> -- 8< --
> Sure, it is (bashisms). This:
>
>   GIT_DIR="$TRASH_DIRECTORY/2/.git" test_repo 2/sub
>
> does not work the same way in all shells when test_repo is a shell
> function. You have to export GIT_DIR explicitly before the function call.

Hmm.. I misread it. That's only for shell _functions_. [1] says variable assignments for simple commands are actually exported.

Junio, please don't pick up this patch.
[1] http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
-- 
Duy
Previous: Nguyen Thai Ngoc DuyNext: Junio C Hamano
Message 8 of 9 in “t1501: avoid bashisms”
  1. 1/2 t1501: avoid bashismsNguyễn Thái Ngọc Duy, Dec 25, 2010
  2. 2/2 setup_work_tree: adjust relative $GIT_WORK_TREE after moving cwdNguyễn Thái Ngọc Duy, Dec 25, 2010
  3. setup_work_tree: adjust relative $GIT_WORK_TREE after moving cwdNguyễn Thái Ngọc Duy, Dec 26, 2010
  4. setup_explicit_git_dir: adjust relative $GIT_WORK_TREE after moving cwdNguyễn Thái Ngọc Duy, Dec 26, 2010
  5. setup_work_tree: adjust relative $GIT_WORK_TREE after moving cwdNguyễn Thái Ngọc Duy, Dec 27, 2010
  6. Andreas SchwabDec 25, 2010
  7. Nguyen Thai Ngoc DuyDec 25, 2010
  8. Nguyen Thai Ngoc DuyDec 25, 2010
  9. Junio C HamanoDec 26, 2010

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.