From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1XRl-0004u8-Mx for qemu-devel@nongnu.org; Tue, 01 Nov 2016 07:41:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1XRj-0006dS-3T for qemu-devel@nongnu.org; Tue, 01 Nov 2016 07:41:41 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:35185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1XRi-0006cL-Ld for qemu-devel@nongnu.org; Tue, 01 Nov 2016 07:41:39 -0400 Received: by mail-wm0-x22c.google.com with SMTP id a197so72723133wmd.0 for ; Tue, 01 Nov 2016 04:41:38 -0700 (PDT) References: <20161028163339.31096-1-alex.bennee@linaro.org> <20161028163339.31096-2-alex.bennee@linaro.org> <20161031021911.GE30303@lemon> <8760o7y0u0.fsf@linaro.org> <20161101103848.GA24975@lemon> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <20161101103848.GA24975@lemon> Date: Tue, 01 Nov 2016 11:41:36 +0000 Message-ID: <8737jbxw9b.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 1/6] tests/docker/Makefile.include: fix diff-index call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org Fam Zheng writes: > On Tue, 11/01 10:02, Alex Bennée wrote: >> >> Fam Zheng writes: >> >> > On Fri, 10/28 17:33, Alex Bennée wrote: >> >> The whole thing is wrapped inside a call quiet-command as well as being >> >> the actual call taking a --quiet argument so the redirect is >> >> superfluous. For reasons I have yet to determine this also seems to be >> >> causing the source preparation step to skip stashing work tree stuff. >> >> >> >> Signed-off-by: Alex Bennée >> >> >> >> --- >> >> TODO: >> >> - properly understand the failure >> > >> > Yep, I don't see the bug on my machine (Fedora 24, git 2.7.4). What about the >> > removed "--"? Does that make a difference for you? >> >> Nope - it seems to be the &>/dev/null that triggers the problem - but >> only in the Makefile. Running the commands from the command line works >> as expected. >> >> However why do we need the redirect here anyway considering the call >> quiet-command? > > It's to force suppressing output, while quiet-command only suppresses the > echoing of the command itself. Since we have "--quiet" here, does "2>/dev/null" > work for you? That works! - (cd $1; if git diff-index --quiet HEAD -- &>/dev/null; then \ + (cd $1; if git diff-index --quiet HEAD -- 2>/dev/null; then \ > > Fam > >> >> > >> >> --- >> >> tests/docker/Makefile.include | 2 +- >> >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> >> >> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include >> >> index 3f15d5a..d91e28b 100644 >> >> --- a/tests/docker/Makefile.include >> >> +++ b/tests/docker/Makefile.include >> >> @@ -20,7 +20,7 @@ IMAGES ?= % >> >> # Make archive from git repo $1 to tar.gz $2 >> >> make-archive-maybe = $(if $(wildcard $1/*), \ >> >> $(call quiet-command, \ >> >> - (cd $1; if git diff-index --quiet HEAD -- &>/dev/null; then \ >> >> + (cd $1; if git diff-index --quiet HEAD; then \ >> >> git archive -1 HEAD --format=tar.gz; \ >> >> else \ >> >> git archive -1 $$(git stash create) --format=tar.gz; \ >> >> -- >> >> 2.10.1 >> >> >> >> >> >> >> -- >> Alex Bennée -- Alex Bennée