From patchwork Tue Jul 23 10:35:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 169491 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8702818ilk; Tue, 23 Jul 2019 03:36:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQ6N+NoM1ODhzPxE4NakxR/1AQHgHVzJ8KD92eIQfd/naoDnjaCDe2YMlRD3TjwX5zLDCh X-Received: by 2002:aa7:c0cf:: with SMTP id j15mr65089122edp.138.1563878192690; Tue, 23 Jul 2019 03:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563878192; cv=none; d=google.com; s=arc-20160816; b=Gz9qEGOr/HYGJt00yF3cbYeIXGlwwua2lc1+B+unkbY29caXAvnzHL9NUSMYJGZShr 8wkS44kYVVpS5qyJVflmpqNg6D4aLLduaRcqfhBADRRY8xDzmpME8oY3k7sgS95XV6/B pvIxBSkBDMQLmf7dIsdBDpfLJTpbtqiOmASMrN0cZ0Kstm42EPzsqlRLGBBFQMJm2LPx KrSzUfqmUZWEtg9+QmZ/bGJMsxN95dLmi3WkzkJdmhbDRUhM/DSMLbmHkYXvUlJ24LR3 B0m2+7AZeBUsv7hlUKAuhCU0vIFr2i700PFmiq8Y0WGdXDDqcz/CL3p8F/fyCRMVqD1E pOKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=15XBOc0K5qrNi75fMYOmlumdevbJac2m4Bpn4CypPlo=; b=gTR6SY0obx7yZBessvaoJSL4aDSULo1GZsl8OaCo7ZkQ0M2dHcw+9q0Deja1qV0GoM KaoPs0pYNzRYdVSRQzar+uZRcIIwY/WhnyDf6q4UbgccUGePMtBsTwvX91NA6G4JZnkH I3QjHlZI2Ook6pIWmFqe5e/9rP433ato/OLGSV2r/xh2gwlbWZe3UYClo+XA9IxuCNhv Vs8NE+2LhxoD/V0QLOYsKKXlp7vQEY8eIY5Lza2/gjHnfK3m8feAkhtE4kIRkgXEmP4G l/P2MSmXe1HpW+eu2dxhqqF0WXrd+uKexHB+25pDTMWGLIlTOWNbG6MlBfsQErCKu0Z9 wERg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=B2DSqrpz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y8si7558580edb.251.2019.07.23.03.36.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2019 03:36:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=B2DSqrpz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hps9n-0005gd-Ar for patch@linaro.org; Tue, 23 Jul 2019 06:36:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37723) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hps9Y-0005e2-Nc for qemu-devel@nongnu.org; Tue, 23 Jul 2019 06:36:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hps9X-0007Jv-Ig for qemu-devel@nongnu.org; Tue, 23 Jul 2019 06:36:16 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:37955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hps9X-0007JG-A1 for qemu-devel@nongnu.org; Tue, 23 Jul 2019 06:36:15 -0400 Received: by mail-wr1-x42a.google.com with SMTP id g17so42618508wrr.5 for ; Tue, 23 Jul 2019 03:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=15XBOc0K5qrNi75fMYOmlumdevbJac2m4Bpn4CypPlo=; b=B2DSqrpzzF0HRMUDsahhhPa6Bolw2/eucsbP25fQ2Yia0RuQkfY9+vJNNzH5gb9929 KlQ5MAEx4kUy/4SlrNBVu+OrLG4JpMQF7XWwMI3dCqf4OcZ13zsfjs+z1Ou8tGZPwpC/ WBggFNrJNODTmexZCvOXtX416sGnGu5SMEAcp4dYq5xehml8Ezs7nRcKZpO9RKImtGdD DbMY5zSky1QUhMML7n+ph/0Vlz2XweuYpJ8l9dw/RCzXRCYw8z0QeEm+PUQ3tHDXzetV 2Oc1UfEobRRd5aKvBwLsqH9CmR4vmafxARNTsICWo87YLtuPlmfwSdr+Kt0Nclo631ep 3rQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=15XBOc0K5qrNi75fMYOmlumdevbJac2m4Bpn4CypPlo=; b=DhpZ6Oc+jV8Beozl1f1KkaE0prVxop9xOrbWjgVsSVL2+2gEkTN0M5cDr4YYsRbbOm iVLuFHhmk7hRrayYg5GEGTay+DoLTLa+Cdwbpo+lckGMAs7FUZnUr/MgcD8Vuumjo0wy 6yhqr0cXl0oLt2VbQ5Lug/cRPmhiQr4SxluAUI3pu4AWatgEsHykr0lZJjpKN4ent8YR XRRfw//1wwrRoLsRXklfoeE7XydnkCWN2buJ7nuLeR4yftTqlV35RcHQjPkdl7jkp2Vs j2N0+pg0CiOmmg1qHnhxaEQNxJv5DJlIHU+sxttmqbyr2BMIZ6PYaajnVUIOcvC5bZo+ HlFQ== X-Gm-Message-State: APjAAAUhR5HJK+pgCsrI20+KTrv3vXn8uTQqYIpCSRN5tiV1j2P7slyq 1R/mdqxgHHaIlHm0DES/3w1ADg== X-Received: by 2002:a05:6000:1203:: with SMTP id e3mr4909090wrx.300.1563878173575; Tue, 23 Jul 2019 03:36:13 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j6sm62376070wrx.46.2019.07.23.03.36.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:36:12 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7153E1FF8C; Tue, 23 Jul 2019 11:36:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 23 Jul 2019 11:35:50 +0100 Message-Id: <20190723103612.5600-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190723103612.5600-1-alex.bennee@linaro.org> References: <20190723103612.5600-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a Subject: [Qemu-devel] [PULL 01/23] archive-source: also create a stash for submodules X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau "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 Message-Id: <20190708200250.12017-1-marcandre.lureau@redhat.com> Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée -- 2.20.1 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"