Re: [PATCH 2/6] test-lib-functions: test_cmp: eval $GIT_TEST_CMP
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Mar 19, 2020, 16:14 UTC
- Message-ID
- <CAPig+cSZvhb4H54QZ=m+A+WF5vg6h014cn5JxiB5N4Om-m2tbw@mail.gmail.com>
- In-Reply-To
- <20200319160211.GC3513282@coredump.intra.peff.net>
On Thu, Mar 19, 2020 at 12:02 PM Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> 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.)