From patchwork Wed Jul 17 13:43:13 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: 169124 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp989497ilk; Wed, 17 Jul 2019 06:43:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbQ8iPWmdJD5jgeS9pD+qG/bT6OswAF9uoHmLbU8HFmYAuIMSlyH4HVgt/s5FtFEbPUhxK X-Received: by 2002:a17:906:b216:: with SMTP id p22mr31584215ejz.273.1563371026358; Wed, 17 Jul 2019 06:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563371026; cv=none; d=google.com; s=arc-20160816; b=bYmav7QyX8PahhT7xJMDHyPuQonBNZevmwvrT/gSlUJiGCDfs6KgMtsnfWfAjcjm/j b5J8mUyRigMPfajujg3EU9ZOW7X7Fv25nGzwFOaqZ7rM1Q7PX+B2iMUVFOx29ZH/Dsub YHd1j8gVAqGsy36hijp80+X3JE+qIxix0GT4SiG+UoZK05DNgPA/wBvyytPKckxcf1nk 7oV1SaA8tFuMPnZuteZRH79Qy2WjaHL3nieH26AJ1zgDZ2r2GhNzF1sP7zNiQTNay548 ixcUlpLimkhnxceD2PlbkYACVzxCcjpTyexaUcZ9AWN8PQ6U7AD1ZLBn2zbFWPQxZTMy WeaQ== 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=KXyc4gTTAJaNXf6dtEqbxh/PAibemTFL8L8bZEMcnns=; b=HwnO/VylLQ6h/aBOfS6Uz7iWOqTGzRMeNyMmv9oR779lnaYrCoNSeEQWKIjlY+zr5t 2bCIGnaN2jqYqMEjRH+C+oZWqjSZBEeCWJ/DYz/nqOzy1QbmDRhH+oA/n4LRh7b9GSON qiKfBYRipfBttFWabqsuxZpujaDDFEzCcN76SeQPzGErY4xleEJ35EHXYyXgu5MXQfVw 16dIooZs77Pui+UWb4qsQxoFdkQ7cDpc1cmulHmJ7+JOfefGeO0MhuZoj0BhHhBB/mV+ DjM708YEH0Ui5E9cu9RgzkRNQ44fmMVw4YJqIX4G3xL+olSXPxCgmnE2Tg1K7Yfk89rt ssUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=A56w0WBT; 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 u9si12523731eji.97.2019.07.17.06.43.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jul 2019 06:43:46 -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=A56w0WBT; 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]:57256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnkDh-0004wY-0j for patch@linaro.org; Wed, 17 Jul 2019 09:43:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55252) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnkDb-0004w3-Ol for qemu-devel@nongnu.org; Wed, 17 Jul 2019 09:43:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnkDa-0004So-Lb for qemu-devel@nongnu.org; Wed, 17 Jul 2019 09:43:39 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hnkDa-0004SC-CA for qemu-devel@nongnu.org; Wed, 17 Jul 2019 09:43:38 -0400 Received: by mail-wr1-x444.google.com with SMTP id y4so24909492wrm.2 for ; Wed, 17 Jul 2019 06:43:38 -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=KXyc4gTTAJaNXf6dtEqbxh/PAibemTFL8L8bZEMcnns=; b=A56w0WBTwgshw6Om7Y2cfUU80UEmSFZ0UoHQKNF9MESrLucdnM4yVB1S3yokjNjdZp FASVdG3kb0JM8ftwcHR4rllm13aHqQ1NrzThD79o4OY17AxzD6mW9oyd64Xxg1KE7Pi3 Nqdqc+pV0hP6Fd8K44DITEXX0dehsjvMpHMU6EA22njjjketYCKWX00MbY0NjHi39zNG 6VwfA4hJXKbWrQGx14GvO1zJelVnAv6gX25y1KP7u2/CxtL6cNbUpK/UnD7y4D5mzlCj ie3ZDB8OxQ/rjrHGAP+RebmKiBL96oNCK3Mf9K10nwMo/oRQAppDLTi8t/q7C6xbP3YW XhTw== 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=KXyc4gTTAJaNXf6dtEqbxh/PAibemTFL8L8bZEMcnns=; b=IWh9slc9trZdW7d0oqQRpeH5Jcs+tKWrKgv6RXLhgh8iGqZZLLqUXdcgxoCgf8m1qB SmQXuuvjHnpiUBIRPsQge4UWgFuUEevAnFnjtt3IQ6UL09FyC+/dUZgunRZXvuZs/Nu5 m1NoH3bgGsTUzuGnQqeiTTvSPCWeJEFLaXVXUIzEsI7OaTngHAfLahpctpG6nU+G6ixj fBt/C8OqrnRwB+KpJ/ktgwHR99S2R/zpIa0/nEyAZqKKiURdAna11B52GTe1D1O7uQRk bWW5q2gY94sO8zKIEjkzBZQAq7kAFTlflCTqrxByTbxgI3H0Mp7eCoXiLXxYDnBJpjME l0Kg== X-Gm-Message-State: APjAAAVJ8yb51Dh+ObqBfWjnGQsTXO4yMuS5UEt0O0IYJy8dsUpw9dLR Gi5V+QG8tQATbCavHspKEKbBYA== X-Received: by 2002:a05:6000:12c8:: with SMTP id l8mr44708060wrx.72.1563371016856; Wed, 17 Jul 2019 06:43:36 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b15sm38821810wrt.77.2019.07.17.06.43.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 06:43:36 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EB31A1FF8C; Wed, 17 Jul 2019 14:43:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 17 Jul 2019 14:43:13 +0100 Message-Id: <20190717134335.15351-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190717134335.15351-1-alex.bennee@linaro.org> References: <20190717134335.15351-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::444 Subject: [Qemu-devel] [PATCH v2 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?= 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 --- scripts/archive-source.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) -- 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"