From patchwork Wed Sep 12 04:43:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 11342 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1B2C123E54 for ; Wed, 12 Sep 2012 04:46:24 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id B30673D39585 for ; Wed, 12 Sep 2012 04:46:23 +0000 (UTC) Received: by ieak11 with SMTP id k11so2184616iea.11 for ; Tue, 11 Sep 2012 21:46:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=C1WqaMkmH0mpvfaOy1gToTTkl47pRYxWM9fE8KJPYgE=; b=Uvk1WLdGGudm5J5Xv46tpeVm/nZO+PaAzrcE90jeZXvQd6ip7DOEs28KCgOZS3g9PW OIk+TaALDo39Ok3cNTwyESV8Hlm3buD1u/7nPw3xOIo+gq5dClw05yHK6FnRwNk6f90u +UtJuhFJ3qKNQ2HifSqThRKQX7NWkA6MQnLMqM+Q5pMx8zcCD0v+bgCO3I+SA0R8zXke WGMxRA3WnbDFoOlWXh+FHIxdOXy7Hzwr962UMaHZbZHtF0sECEduBoMALPtaErWE5uBc xpOySl7OFBh3THuL/aPzInEKaMa9gt5j2enfHAX/8cGYQdz7UrCYDbfMu5D3dGVnVQiG qGPQ== Received: by 10.50.89.164 with SMTP id bp4mr166543igb.28.1347425182876; Tue, 11 Sep 2012 21:46:22 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp49898igc; Tue, 11 Sep 2012 21:46:22 -0700 (PDT) Received: by 10.68.226.167 with SMTP id rt7mr14918827pbc.146.1347425181903; Tue, 11 Sep 2012 21:46:21 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id wn9si10828936pbc.174.2012.09.11.21.46.21 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 21:46:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by dade7 with SMTP id e7so881572dad.37 for ; Tue, 11 Sep 2012 21:46:21 -0700 (PDT) Received: by 10.66.75.232 with SMTP id f8mr2506396paw.59.1347425181391; Tue, 11 Sep 2012 21:46:21 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id it6sm10834873pbc.14.2012.09.11.21.46.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 21:46:19 -0700 (PDT) From: Tushar Behera To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mmarek@suse.cz, patches@linaro.org Subject: [PATCH] kbuild: setlocalversion: ignore private tags while reporting local version Date: Wed, 12 Sep 2012 10:13:16 +0530 Message-Id: <1347424996-15569-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQm3raNvIeiFlKi5EWb+euje+pefKGSPkZtWJmHuKTHqrlO1L2ipol6XlVm6uB/aM2jO5KWM The output 'git describe' is relative to the immediate preceding tag. When the immediate tag preceding the HEAD is a private tag, setlocalversion extracts information with respect to the private tag and wrongly reports them with respect to Linux tag. Fixing this to extract information with respect to Linux tags. CC: Michal Marek Signed-off-by: Tushar Behera --- scripts/setlocalversion | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/scripts/setlocalversion b/scripts/setlocalversion index bd6dca8..d2c857c 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -57,7 +57,8 @@ scm_version() fi # If we are past a tagged commit (like # "v2.6.30-rc5-302-g72357d5"), we pretty print it. - if atag="`git describe 2>/dev/null`"; then + # Also match linux tags pattern to discard private tags + if atag="`git describe --match v[2-9].* 2>/dev/null`"; then echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' # If we don't have a tag at all we print -g{commitish}.