From: Eric Sunshine Date: Thu, 19 Mar 2020 16:14:09 GMT Subject: Re: [PATCH 2/6] test-lib-functions: test_cmp: eval $GIT_TEST_CMP Message-ID: In-Reply-To: <20200319160211.GC3513282@coredump.intra.peff.net> On Thu, Mar 19, 2020 at 12:02 PM Jeff King wrote: > On Thu, Mar 19, 2020 at 09:00:03PM +0700, Đoàn Trần Công Danh wrote: > > > test_cmp:1: command not found: diff -u > > > > Using `eval` to unquote $GIT_TEST_CMP as same as precedence in `git_editor`. > > I do worry that this whitespace splitting behavior could bite us in > other scripts. Curiously, my version of busybox (1.30.1) doesn't seem to > have any problem with it, though. I had the same reaction upon reading the patch. It's not just other scripts in which the problem might manifest, but a change to the value of some variable which is used as a command invocation. Providing a "fix" for this one particular case may help get past test a failure on Alpine under busybox, but it is not a good general solution. (Some sort of helper function which smooths away differences like this -- say git_indirect_cmd() or something -- which can be used wherever a $VARIABLE is invoked as a command might be a better approach, but I haven't really thought it through.)