diff mbox series

[RFC,for,2.10,3/3] docker: ignore submodules when checking diff

Message ID 20170720134716.13049-4-alex.bennee@linaro.org
State Superseded
Headers show
Series some docker fixes | expand

Commit Message

Alex Bennée July 20, 2017, 1:47 p.m. UTC
The QEMU tree often has dirty submodules in it but this will confuse
things as git stash is not going to save their state directly. They
are likely just dirty from build files anyway. Ignore them in the
diff-index command.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/docker/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.13.0

Comments

Eric Blake July 20, 2017, 1:57 p.m. UTC | #1
On 07/20/2017 08:47 AM, Alex Bennée wrote:
> The QEMU tree often has dirty submodules in it but this will confuse

> things as git stash is not going to save their state directly. They

> are likely just dirty from build files anyway. Ignore them in the

> diff-index command.


It's annoying that our build dirties a submodule in the first place; it
would be nice to get rid of those bugs in our build process (ideally,
the build should treat submodule directories as read-only).  But that is
a bigger effort, so I'm okay with your hack in the meantime.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  tests/docker/Makefile.include | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)


Reviewed-by: Eric Blake <eblake@redhat.com>


> 

> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include

> index ff580edfad..2a560a5327 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 -- 2>/dev/null; then \

> +		(cd $1; if git diff-index --quiet --ignore-submodules HEAD -- 2>/dev/null; then \

>  			git archive -1 HEAD --format=tar.gz; \

>  		else \

>  			git archive -1 $$(git stash create) --format=tar.gz; \

> 


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
diff mbox series

Patch

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index ff580edfad..2a560a5327 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 -- 2>/dev/null; then \
+		(cd $1; if git diff-index --quiet --ignore-submodules HEAD -- 2>/dev/null; then \
 			git archive -1 HEAD --format=tar.gz; \
 		else \
 			git archive -1 $$(git stash create) --format=tar.gz; \