git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Carl Worth <cworth@cworth.org>
Subject: Re: [PATCH] test-lib: use subshell instead of cd $new && .. && cd $old
Date: Mon, 30 Aug 2010 11:04:44 -0500	[thread overview]
Message-ID: <20100830160444.GE3292@burratino> (raw)
In-Reply-To: <AANLkTi=z9uUB_YZ9Sb0O8JzaEjazKDzqB=ZVtqTTDf2K@mail.gmail.com>

Ævar Arnfjörð Bjarmason wrote:
> On Mon, Aug 30, 2010 at 15:57, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Ævar Arnfjörð Bjarmason wrote:

>>> -     cd "$repo" || error "Cannot setup test environment"
>>> +     (cd "$repo" || error "Cannot setup test environment"
>>>       "$GIT_EXEC_PATH/git-init" "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
>>>       error "cannot run git init -- have you built things yet?"
>>> -     mv .git/hooks .git/hooks-disabled
>>> -     cd "$owd"
>>> +     mv .git/hooks .git/hooks-disabled)
>>
>> Style: why not use
>>
>>        (
>>                cd "$repo" ...
>>                ... .git/hooks-disabled
>>        )
>>
>
> I've seen both used and I don't know which is preferred.

Okay.  I maintain that the latter is way more readable.  Is there any
advantage to the former?

Whichever the project chooses can be enshrined in
Documentation/CodingGuidelines, of course.

  reply	other threads:[~2010-08-30 16:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 12:00 [PATCH] test-lib: use subshell instead of cd $new && .. && cd $old Ævar Arnfjörð Bjarmason
2010-08-30 15:57 ` Jonathan Nieder
2010-08-30 16:01   ` Ævar Arnfjörð Bjarmason
2010-08-30 16:04     ` Jonathan Nieder [this message]
2010-08-31 17:58   ` Junio C Hamano
2010-08-31 18:11     ` Ævar Arnfjörð Bjarmason

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=20100830160444.GE3292@burratino \
    --to=jrnieder@gmail.com \
    --cc=avarab@gmail.com \
    --cc=cworth@cworth.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 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 NNTP newsgroup(s).