diff mbox

[1/6] tests/docker/Makefile.include: fix diff-index call

Message ID 20161028163339.31096-2-alex.bennee@linaro.org
State New
Headers show

Commit Message

Alex Bennée Oct. 28, 2016, 4:33 p.m. UTC
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 <alex.bennee@linaro.org>


---
TODO:
  - properly understand the failure
---
 tests/docker/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.10.1

Comments

Fam Zheng Oct. 31, 2016, 2:19 a.m. UTC | #1
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 <alex.bennee@linaro.org>

> 

> ---

> 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?

> ---

>  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 Oct. 31, 2016, 11:55 a.m. UTC | #2
Fam Zheng <famz@redhat.com> 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 <alex.bennee@linaro.org>

>>

>> ---

>> 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?


The -- seems superfluous as we are not giving it a list of files to
check against. I was seeing the problem with known files with changes
which were not committed.

My setup is Ubuntu 16.04 with git 2.10.1 (I track upstream stable).

>

>> ---

>>  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 Nov. 1, 2016, 10:02 a.m. UTC | #3
Fam Zheng <famz@redhat.com> 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 <alex.bennee@linaro.org>

>>

>> ---

>> 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?

>

>> ---

>>  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
Fam Zheng Nov. 1, 2016, 10:38 a.m. UTC | #4
On Tue, 11/01 10:02, Alex Bennée wrote:
> 

> Fam Zheng <famz@redhat.com> 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 <alex.bennee@linaro.org>

> >>

> >> ---

> >> 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?

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 Nov. 1, 2016, 11:41 a.m. UTC | #5
Fam Zheng <famz@redhat.com> writes:

> On Tue, 11/01 10:02, Alex Bennée wrote:

>>

>> Fam Zheng <famz@redhat.com> 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 <alex.bennee@linaro.org>

>> >>

>> >> ---

>> >> 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
diff mbox

Patch

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; \