From patchwork Tue May 10 09:52:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Randolf X-Patchwork-Id: 620544 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-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r3vnd0t6cz9snm for ; Tue, 10 May 2016 19:57:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=einfach.org header.i=@einfach.org header.b=mAPYMVOt; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b04PB-0003G1-J2; Tue, 10 May 2016 09:56:41 +0000 Received: from postler.einfach.org ([5.9.2.179]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b04LI-0004Wv-Op for lede-dev@lists.infradead.org; Tue, 10 May 2016 09:52:58 +0000 Received: from [192.168.5.9] (unknown [188.85.182.38]) by postler.einfach.org (Postfix) with ESMTPSA id 83CA5AD5; Tue, 10 May 2016 09:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=einfach.org; s=mail; t=1462873937; bh=yaQP4D5LFYh449LTcGh8J/sGmLbQzYlxFjhn0dJUcyc=; h=Subject:To:References:From:Date:In-Reply-To; b=mAPYMVOtSpHBBzhAOgsHfKOg7CwFXZJXgmYscrb4vl5Br8CNyoa3eACV+9r9Tj7mc woYogRDcCy2TtybKHALrDN9NbLd3HBFyxWWbz9jhrBZ3giPuXYQmnZt99wHWeByTds U2qmY4QySDk2QnrTVBCDDw6EWcbphiyD11SjeJb8= To: Hannu Nyman , lede-dev@lists.infradead.org References: <1462493792-28274-1-git-send-email-lede@daniel.thecshore.com> <1fff463a-fadb-22bc-ae0d-d2280ec93d1a@iki.fi> From: Bruno Randolf Message-ID: <5731AF50.6010503@einfach.org> Date: Tue, 10 May 2016 10:52:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1fff463a-fadb-22bc-ae0d-d2280ec93d1a@iki.fi> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (postler.einfach.org [0.0.0.0]); Tue, 10 May 2016 09:52:17 +0000 (UTC) X-Virus-Scanned: clamav-milter 0.98.7 at bced1da0f74a X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160510_025241_780262_91FFD1E4 X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.1 (----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-4.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -2.1 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: Re: [LEDE-DEV] [PATCH] More OpenWrt -> LEDE renames X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On 10/05/16 09:33, Hannu Nyman wrote: > The contents of those files, the related config options and the sources > for each items might maybe be rationalised at the same time. Good idea. I think most of this can be beautifully handled by using git tags and "git describe". Basically the simple idea is to tag a release, so releases will have a clean name such as "15.05.1". I'll use "15.05.1" as an example. Changes after that release would be shown as TAG-NrOfCommits-Hash, e.g. "15.05.1-14-ge1357c0" (14 commits after 15.05.1, you can uniquely identify the commit by hash ge1357c0). Improvements, such as including branch names would be possible, too. Also see my patch below. > There are at least four different kind of builds: > * trunk snapshots/builds: Trunk codename designation, no release number, > source revision, opkg download from snapshot repo Could as well be git describe based on last tag as e.g. "15.05.1-1238-ge1357c0". Or if you care about the name, we can tag master with (say) "DD", or "master" after branching, then you'd have "DD-1234-hash" > * branch builds before release: Branch codename designation, release > branch number known but no release yet, source revision Tag as "15.05.1-rc1", "15.05.1-rc2"... > * branch release builds: Branch codename designation, official release > number, source revision, opkg download from release repo Once a rc becomes a release, tag with "15.05.1" and rebuild. > * branch builds after a release: Branch codename designation, last > release number known + changes after it, source revision, opkg download > from last release repo Would automatically happen as explained above, e.g. "15.05.1-14-ge1357c0" Greetings, bruno diff --git a/include/version.mk b/include/version.mk index 9348a24..8bc5319 100644 --- a/include/version.mk +++ b/include/version.mk @@ -21,7 +21,7 @@ qstrip_escape=$(subst ','\'',$(call qstrip,$(1))) #' VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),15.05) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),$(REVISION)) VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER)) VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),Chaos Calmer) diff --git a/scripts/getver.sh b/scripts/getver.sh index 4643ca6..fa542f1 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -17,9 +17,7 @@ try_svn() { } try_git() { - [ -e .git ] || return 1 - REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }')" - REV="${REV:+r$REV}" + REV="$(git describe --tags --dirty)" [ -n "$REV" ] }