[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 01/23] archive-source: also create a stash for su
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v2 01/23] archive-source: also create a stash for submodules |
Date: |
Wed, 17 Jul 2019 14:43:13 +0100 |
From: Marc-André Lureau <address@hidden>
"git archive" fails when a submodule has a modification, because "git
stash create" doesn't handle submodules. Let's teach our
archive-source.sh to handle modifications in submodules the same way
as qemu tree, by creating a stash.
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
---
scripts/archive-source.sh | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh
index ca94e49978f..fb5d6b3918d 100755
--- a/scripts/archive-source.sh
+++ b/scripts/archive-source.sh
@@ -39,14 +39,16 @@ function cleanup() {
}
trap "cleanup" 0 1 2 3 15
-if git diff-index --quiet HEAD -- &>/dev/null
-then
- HEAD=HEAD
-else
- HEAD=$(git stash create)
-fi
+function tree_ish() {
+ local retval='HEAD'
+ if ! git diff-index --quiet --ignore-submodules=all HEAD -- &>/dev/null
+ then
+ retval=$(git stash create)
+ fi
+ echo "$retval"
+}
-git archive --format tar $HEAD > "$tar_file"
+git archive --format tar "$(tree_ish)" > "$tar_file"
test $? -ne 0 && error "failed to archive qemu"
for sm in $submodules; do
status="$(git submodule status "$sm")"
@@ -62,7 +64,7 @@ for sm in $submodules; do
echo "WARNING: submodule $sm is out of sync"
;;
esac
- (cd $sm; git archive --format tar --prefix "$sm/" $smhash) > "$sub_file"
+ (cd $sm; git archive --format tar --prefix "$sm/" $(tree_ish)) >
"$sub_file"
test $? -ne 0 && error "failed to archive submodule $sm ($smhash)"
tar --concatenate --file "$tar_file" "$sub_file"
test $? -ne 0 && error "failed append submodule $sm to $tar_file"
--
2.20.1
- [Qemu-devel] [PATCH v2 00/23] testing/next for 4.1-rc2 (win, travis, iotests), Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 01/23] archive-source: also create a stash for submodules,
Alex Bennée <=
- [Qemu-devel] [PATCH v2 02/23] tests/docker: add test-misc for building tools & docs, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 03/23] tests/docker: Install Sphinx in the Ubuntu images, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 05/23] tests/docker: Install Ubuntu images noninteractively, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 04/23] tests/docker: Install Sphinx in the Fedora image, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 06/23] tests/migration-test: don't spam the logs when we fail, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 08/23] shippable: re-enable the windows cross builds, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 07/23] tests/dockerfiles: update the win cross builds to stretch, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 09/23] tests/docker: Install Sphinx in the Debian images, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 10/23] tests/docker: Install the NSIS tools in the MinGW capable images, Alex Bennée, 2019/07/17
- [Qemu-devel] [PATCH v2 12/23] tests/docker: Install texinfo in the Fedora image, Alex Bennée, 2019/07/17