From patchwork Sat Jan 14 21:34:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Kroken X-Patchwork-Id: 715380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v1CSn1flkz9t14 for ; Sun, 15 Jan 2017 08:34:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="j+iJwZDu"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cSVyA-0004Mh-26; Sat, 14 Jan 2017 21:34:38 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cSVy6-0004LF-V4 for lede-dev@lists.infradead.org; Sat, 14 Jan 2017 21:34:37 +0000 Received: by mail-wm0-x232.google.com with SMTP id d140so2603687wmd.0 for ; Sat, 14 Jan 2017 13:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yl9HxC2o1B4buTRm1Z7K/NVjMSniD8exnWMJeuGgnlM=; b=j+iJwZDu1TrvwTcmnipTpn7Dz7U531T8TMtqZY71g9QLo0etM+bIZMhHM59JssL0Yt b0fMR6XZ38JnrMzGIG9nDdz38dyTm2UmnmVpzN4fLyIwLXXY3qtGcGtsZIOE7eSMX0os Fdim4BwFAPrNY68xxUor+nmsoTyrcfy3x50YjThPLZ0qzT/HUcB7g3cqwMK4S8DTIJ6g 0V/ECYc0hMTS3IxwC/HQwFjcGnYr5y13L4T4DP/IE574oR5ZmGuXxl9nNM6y35oG7i6+ EYo9xU7Twyq3xAVUgf1npXJyps63j7FpL/BkIYFFUjpf7Vbk6P84ZBM1LrWGGk8UZTwb F7lw== 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; bh=yl9HxC2o1B4buTRm1Z7K/NVjMSniD8exnWMJeuGgnlM=; b=YOEp4GFJcrN7mywY7tveNqvbDUN+Z1661GCSPjuiOBcHp/z5vdGJ8NWSOLN8QJAVN2 6dkPt9SoAT1epCqzJmlPVWestwB4oeGJu4djdxgirRkqpufvJHrVli2HDA5l8jE4b6kc 3CXediG3Fo9nI+HkmWd/0p0458u+hPv4L70c3mD+IlvMyu+Vhl+hgWrfhlnEsFG0AVhJ CXam9xU8i+QK7exvbvZWepGnFWLFMDNM9njPNBkGinUrp65C/KCHyojqCF3UsKfOS3ok FdhOVy47oM46jURp307aGAyFLLxkjAmFTytD2ZwCZtLymLzhqdo8fYTA8LR+GzsPty81 3pZA== X-Gm-Message-State: AIkVDXKz+zlWdaGAJboFCkyDe97yHt0KRf1E5g5EqGf6geIW9aWU2mPVS2ap9MY7lpdS4A== X-Received: by 10.28.158.74 with SMTP id h71mr7054639wme.59.1484429650482; Sat, 14 Jan 2017 13:34:10 -0800 (PST) Received: from localhost.localdomain (99.92-221-173.customer.lyse.net. [92.221.173.99]) by smtp.gmail.com with ESMTPSA id r5sm15658249wme.23.2017.01.14.13.34.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Jan 2017 13:34:09 -0800 (PST) From: Magnus Kroken To: lede-dev@lists.infradead.org Date: Sat, 14 Jan 2017 22:34:01 +0100 Message-Id: <1484429641-7313-1-git-send-email-mkroken@gmail.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170114_133435_183255_78910380 X-CRM114-Status: UNSURE ( 9.42 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:232 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mkroken[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [LEDE-DEV] [PATCH] scripts/getver.sh: append short git hash based on upstream commit X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Magnus Kroken MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The short git hash suffix printed by getver.sh is taken from the latest local commit, change this to use the hash from latest upstream commit if available. This is considered the intended behavior based on commit message a642a11faca87e2a7bddc1fadb54253e2fc26e84, introducing getver.sh. Signed-off-by: Magnus Kroken Signed-off-by: Morteza Milani --- The referenced commit message says: The new output format will look like "r2400+2-882472e" for dirty trees or like "r2402-882472e" for clean ones. Since the example hashes are the same, I take this to mean that this was the intended behavior. Intended or not, I would suggest this anyway. If someone provides a LEDE version number from a dirty tree, e.g. r2961+8-abcdef01, you need access to a LEDE Git tree and ability to run getver.sh to look up which commit r2961 corresponds to. The short hash (abcdef01) is from the dirty tree, and can be anything that person has committed. Appending the upstream base commit hash is useful when people ask for help and you want to track down the commit they're based on, and you may not have a running LEDE build environment available. Knowing that a tree is dirty (+8) is useful as well, but the commit hash is only useful to people who have access to the dirty tree. scripts/getver.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/getver.sh b/scripts/getver.sh index ecf048f..4d594d3 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -40,7 +40,12 @@ try_git() { REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))" fi - REV="${REV:+r$REV-$(git log --format="%h" -1)}" + if [ -n "$UPSTREAM_BASE" ]; then + REV="${REV:+r$REV-$(git log -n 1 --format="%h" $UPSTREAM_BASE)}" + else + REV="${REV:+r$REV-$(git log --format="%h" -1)}" + fi + ;; esac