Re: [PATCH] test-lib: use subshell instead of cd $new && .. && cd $old

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason wrote:
> On Mon, Aug 30, 2010 at 15:57, Jonathan Nieder <jrnieder@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]