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: 1440891 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 828C94025E for ; Wed, 12 Sep 2012 04:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751467Ab2ILEqW (ORCPT ); Wed, 12 Sep 2012 00:46:22 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:59980 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215Ab2ILEqV (ORCPT ); Wed, 12 Sep 2012 00:46:21 -0400 Received: by pbbrr13 with SMTP id rr13so1709781pbb.19 for ; Tue, 11 Sep 2012 21:46:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=C1WqaMkmH0mpvfaOy1gToTTkl47pRYxWM9fE8KJPYgE=; b=eDbuku4lEvGSUsNlccJMKeQxX4p/Aud091/oXLzVi/UnHBL8eyVUdeGINPvhtw2q50 bQpFhihaTZ0FdOTV/UkOGU6y5U//o8n/DTu5SGKbX7tvEp3KZ3jwb9GPJ1uxO80oNrd1 kzFepiCXpl1selKldxqH3hHHBHZzTUnBV32QamueDuvFLCvcfknp/SPVoxkMjcfMwRlQ QLApyQfvoC5C+U+4Y/NWmSUTjgNEgeASDToZD0+VOqIdyzKKpr8HWbXOm/n/A+x3SDc7 /i5vs0LwMbvrozmOPw3sMfdGsNAQaRBT/6PgD1vjST5FJuY67qkIRHf6w6BxWqd/CxXW OzFg== 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: ALoCoQlm1sD2YJ6RIHj/hdUunXI1sKPQ16mzYCapF2aHzVMGZEEC7JqjTDm1DhjPv4gBITSb7Xq+ Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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}.