From patchwork Mon Apr 24 16:50:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC1ABC77B73 for ; Mon, 24 Apr 2023 16:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232204AbjDXQux (ORCPT ); Mon, 24 Apr 2023 12:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbjDXQut (ORCPT ); Mon, 24 Apr 2023 12:50:49 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6976590 for ; Mon, 24 Apr 2023 09:50:45 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-38e3a1a07c8so2877392b6e.0 for ; Mon, 24 Apr 2023 09:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355044; x=1684947044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mhyABzB19F127sXkh/fN/OWuVNaEINGwbxe9YoZbzNI=; b=BYi2ksaMQLfEyH0rj+mIRmODzsAerqCTJnYwuTHoKKQkOuR7Gbn5+Wy0V4DKol9QFy Z1gI6C8mV239q0vtWYmWy9ixrDGICKoCFIZDViSl9XXkFBi+mC+0ODK6ZnMWawRdQY1A 6Fp4s3GAoHOfEJd4O5PzLlmSNakLqfjE88q7qZ1b0fTc8xorq8+H12XELKf75lxbp5uQ qMCV/I5KZSfesZF4MOGu+IsNGEUl/xCL0RfRMmMA97kZPGcU3737AofYxjEjHrBQ4zCU icfaFSzwPhyKWoK31GSVUAhUA9ZJ/dr7AkZMYn2RlHwI9CoUeVkrFpO+v3V39pO8kauJ lazw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355044; x=1684947044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mhyABzB19F127sXkh/fN/OWuVNaEINGwbxe9YoZbzNI=; b=d3351GwH6YWmLNCcunjv7BRli1cJNEQXVT4CKjTT1co8WHHGLfnXfg1fv7omBYmMtT APLh84Q3YNtTDkUyvup5lRq1cRNVx1zwH03/mJ7dxVtARjQLksoPTReniB1gNzdVfM0r yIpY0zV7SaRLQUn34sWK0nBY91W6zjxJmKmP8dkMCXO1xt1eSqJHeAX9QJD58z8ebhES T6qx2Bc4+4JFTO1c0wayq11ii5EiOv51pL3TWkNQQ3TryGSGDeTOqigGwgiaV5KXk+jA 4AWXnedaOw8wRj/HSrBKC9afs/EUF7TxQrZbBQz/JPn8pntH4qVvlW4iMHBkrJWWALwY VE2A== X-Gm-Message-State: AAQBX9dwk2wrT5QZ39CYowz7uvPq9uYTuLGbsw8oUeW0Ay7VJsJqgR8d n7V9RAqk350f8+ygdZPTqEchpDfafHU= X-Google-Smtp-Source: AKy350a+vQSQplHHiXvMIgAb+LgeNRFn/C0kisBy+8Xop5nfmFXRstQDrhn07jvmIfB/OaA6B1VWRA== X-Received: by 2002:a05:6808:a11:b0:38e:2804:4bfb with SMTP id n17-20020a0568080a1100b0038e28044bfbmr6748699oij.5.1682355044046; Mon, 24 Apr 2023 09:50:44 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id z9-20020a4aae09000000b005421d52de9csm4944052oom.45.2023.04.24.09.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:43 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 01/15] version-gen: reorganize Date: Mon, 24 Apr 2023 10:50:27 -0600 Message-Id: <20230424165041.25180-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Simply move some code into a `describe` function so it's clear what code is related to dealing with `git describe`, and what code is the main functionality. No functional changes. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 9a1111af9b..29d634a30b 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -6,20 +6,27 @@ DEF_VER=v2.40.GIT LF=' ' +describe () { + VN=$(git describe --match "v[0-9]*" HEAD 2>/dev/null) || return 1 + case "$VN" in + *$LF*) + return 1 + ;; + v[0-9]*) + git update-index -q --refresh + test -z "$(git diff-index --name-only HEAD --)" || + VN="$VN-dirty" + return 0 + ;; + esac +} + # First see if there is a version file (included in release tarballs), # then try git-describe, then default. if test -f version then VN=$(cat version) || VN="$DEF_VER" -elif test -d ${GIT_DIR:-.git} -o -f .git && - VN=$(git describe --match "v[0-9]*" HEAD 2>/dev/null) && - case "$VN" in - *$LF*) (exit 1) ;; - v[0-9]*) - git update-index -q --refresh - test -z "$(git diff-index --name-only HEAD --)" || - VN="$VN-dirty" ;; - esac +elif test -d ${GIT_DIR:-.git} -o -f .git && describe then VN=$(echo "$VN" | sed -e 's/-/./g'); else From patchwork Mon Apr 24 16:50:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71CCFC77B61 for ; Mon, 24 Apr 2023 16:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232220AbjDXQu5 (ORCPT ); Mon, 24 Apr 2023 12:50:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232125AbjDXQuu (ORCPT ); Mon, 24 Apr 2023 12:50:50 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F12B6E80 for ; Mon, 24 Apr 2023 09:50:46 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6a604259983so3720411a34.2 for ; Mon, 24 Apr 2023 09:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355045; x=1684947045; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YoxuHttwGlHpw0iLHk9kbmg5mFYOxafVOewfrSGopK8=; b=kws+ZNzWb4MAI4sZBfbW0KjKYBdHA6jEeO8xoVcZMXHxMnN/WqjaVh7k0TxDKZM2E+ 6PobSuNT1iHD51eIt0+xsrJQIDvYfFQ1NYIOMY5T63oT4rXOJ2M16HNtG6z1/ZOiDkCf jbAGfGRtzY1oIbKs48PDuI53iscVTXv7CvcnjqTFRgCcEbQ+C/OWH0ke/RAPrYFrWaVm 4/n0N35va7Aam0cJG8vYWIC0PHYZcfpnzzliF3VXoHgk50liBjaa0Mqx8kLynV/fD4d3 r/u6nErm1KLkp+NlAy2w707oQ2EGfR5iSHEsx36NIQOgoCa3DMUFabPAwOqw/46OJmo0 IVAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355045; x=1684947045; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YoxuHttwGlHpw0iLHk9kbmg5mFYOxafVOewfrSGopK8=; b=Ki5UzXD/ZQ7oRrExxVwCUiSL7E+E4YwXIVIlgB4Vo+V59k/7wXuHVhs43fBAGz3Jm4 VwUqNnMg7A8JO8aDexDqmF6uSrZJBl7ieLtRcD8ioQMKJenXQZIwfnVIN27drcgVyuv/ I8iZX1otP50crcietvy/EkXoXQRlREuNRtcy2Csbpr2oxQo30muYBmCoD709YtxlNwBh JDxZE3gpcDnKlOjHFHaca2lGADd6XNgb0pccWqpfEzAe2y1cNQkD6XXLmzv9HjmOdCML NuNkeljXQozjK/zdiLRUVi7LGaLsgckXtYc3Ozzvuck5q3hUaZtIflZMGd5ArVLRXRo9 zD6Q== X-Gm-Message-State: AAQBX9c044zFxPt9Kx0Z+s+RPi8zcns43O3U/X9/kPsCDIKz4HdnAtvb OLU53laflKHm6TtvwpiNEJYNdU5iVAY= X-Google-Smtp-Source: AKy350b8xB+pS08P/RTE+vtsT+OYHx8D56EEHJ1NNYE1pAQ/9JIuA+ApY5YPxoL+3a+b0ezuo36u6Q== X-Received: by 2002:a05:6870:4150:b0:187:cebb:ce1 with SMTP id r16-20020a056870415000b00187cebb0ce1mr9183221oad.33.1682355045330; Mon, 24 Apr 2023 09:50:45 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id i4-20020a056870864400b0018e996a507esm1438684oal.31.2023.04.24.09.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:44 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 02/15] version-gen: trivial cleanup Date: Mon, 24 Apr 2023 10:50:28 -0600 Message-Id: <20230424165041.25180-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We don't use `git-foo` since git 1.6. HEAD is the default of `git describe`. Also, deal with a bunch of shellcheck warnings. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 29d634a30b..6dd7683ee7 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -7,7 +7,7 @@ LF=' ' describe () { - VN=$(git describe --match "v[0-9]*" HEAD 2>/dev/null) || return 1 + VN=$(git describe --match "v[0-9]*" 2>/dev/null) || return 1 case "$VN" in *$LF*) return 1 @@ -22,26 +22,24 @@ describe () { } # First see if there is a version file (included in release tarballs), -# then try git-describe, then default. +# then try `git describe`, then default. if test -f version then VN=$(cat version) || VN="$DEF_VER" -elif test -d ${GIT_DIR:-.git} -o -f .git && describe +elif test -d "${GIT_DIR:-.git}" -o -f .git && describe then - VN=$(echo "$VN" | sed -e 's/-/./g'); + VN=$(echo "$VN" | sed -e 's/-/./g') else VN="$DEF_VER" fi -VN=$(expr "$VN" : v*'\(.*\)') +VN=$(expr "$VN" : 'v*\(.*\)') if test -r $GVF then VC=$(sed -e 's/^GIT_VERSION = //' <$GVF) else - VC=unset + VC='unset' fi -test "$VN" = "$VC" || { - echo >&2 "GIT_VERSION = $VN" - echo "GIT_VERSION = $VN" >$GVF -} +test "$VN" = "$VC" && exit +echo "GIT_VERSION = $VN" | tee $GVF >&2 From patchwork Mon Apr 24 16:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18FF7C7618E for ; Mon, 24 Apr 2023 16:50:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232216AbjDXQuz (ORCPT ); Mon, 24 Apr 2023 12:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232014AbjDXQuu (ORCPT ); Mon, 24 Apr 2023 12:50:50 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E9C96E98 for ; Mon, 24 Apr 2023 09:50:47 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6a5f21a231eso3307619a34.1 for ; Mon, 24 Apr 2023 09:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355046; x=1684947046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NcvgWFXKvgw9IRDZJw9QoZqVIf+9jTj1q270nYCiN5E=; b=lpuP7VA7zFrGm2TwDj19Bm9X0sUMfzCH6dOBaCRyUKvIJaqDAw1TnCj/AXMFNePtD9 xOrluVmglUOPWyjujYnIr3S/Y89MjUUSHXgBxKqa+9xkwnnZ8ZgBu+NAqgVUGmu4oR6q AjBRyE0zeDQjXeFS11o1LD4lkscoUigA8CbrhPjopGgxpW8i5COiTQopKsbWGgUw7vbG ggxlaWGlQ7oszhC66WNUoOkfoLvb7sgRC5pGeN2gij6scw9mSeTlZY119vmRfext0/qR ud6adXR9C/3xzvQg3OqUcDxkR1SrHB65Wq2bxAahKHcPETL6AKZwoumUZscUWmfYh9UZ 7Bxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355046; x=1684947046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NcvgWFXKvgw9IRDZJw9QoZqVIf+9jTj1q270nYCiN5E=; b=iobmwqFxnFbA/E8f0SJGJlPb/PFytF8qeBOBv6qgpJgIc72yfx0xvY54i+doNwHdkV PlATBsn5EPsYDx67N8IF8cdEYV9L9dknW82Rsy4RyvT/eFLRf9yZAzTzV3QEshRLvr28 GNItuqlQ40purZbDnw8vxCgR6L7SPaeJMHsk65F5LG9J6I47lhejQi6cGbK1iff+9vRv QDJR4JKbarjwRhOX3AH/GRcNZLgiahcyKlMyvzvhqvkL8BGC6zvx10p3Ze9QrfMTy9Dp RJtkIproSv7RXftDzd5NvkOBJFdYwt4/Vv+2KnZpgmcEZisYUdeZuyLsuscbcjrIUwrO epHQ== X-Gm-Message-State: AAQBX9ce//WY9rfuXTyp3jdsygnpHVPWlSNRXSd0lDpDcRftgK0Nl0G4 dmfHgmF+h5PmKvsv27LjeluvjuSTwHw= X-Google-Smtp-Source: AKy350Yf8qMGlNarxVevKXKQ8CDQOqg5fdIq5Kcq1qAI2Y+i3+INVIZl96TpEhSYR4K0JDboNEpuaw== X-Received: by 2002:a9d:5c08:0:b0:6a3:4e22:2bd with SMTP id o8-20020a9d5c08000000b006a34e2202bdmr7017438otk.5.1682355046583; Mon, 24 Apr 2023 09:50:46 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id n20-20020a9d64d4000000b006a5fae26f18sm4745677otl.39.2023.04.24.09.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:46 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 03/15] version-gen: refactor default version Date: Mon, 24 Apr 2023 10:50:29 -0600 Message-Id: <20230424165041.25180-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It's not clear how `cat version` might fail, but either way if VN is empty (or unset), assign the default value. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 6dd7683ee7..0d00fa3d9a 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -25,14 +25,14 @@ describe () { # then try `git describe`, then default. if test -f version then - VN=$(cat version) || VN="$DEF_VER" + VN=$(cat version) elif test -d "${GIT_DIR:-.git}" -o -f .git && describe then VN=$(echo "$VN" | sed -e 's/-/./g') -else - VN="$DEF_VER" fi +: "${VN:=$DEF_VER}" + VN=$(expr "$VN" : 'v*\(.*\)') if test -r $GVF From patchwork Mon Apr 24 16:50:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222420 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D771C77B61 for ; Mon, 24 Apr 2023 16:50:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231173AbjDXQuw (ORCPT ); Mon, 24 Apr 2023 12:50:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbjDXQuu (ORCPT ); Mon, 24 Apr 2023 12:50:50 -0400 Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADD777686 for ; Mon, 24 Apr 2023 09:50:48 -0700 (PDT) Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-187d9c205e9so3317099fac.3 for ; Mon, 24 Apr 2023 09:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355047; x=1684947047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SealYxV1P0U6WM8/BkNmOSbeoydiMVThybk/G9EJ+VA=; b=fP4zPffGRzFKLCgxKxVHpSUwFbX5rwIOb7lRFvyYpF4OJUhYwkob46N9/Qllf78RA/ ztM5Q/C0fGneypafuDVbHiOwM/fV7Lva21HNshvs6G0qvx5xxnpWmcXNx8wYrK7a9RvH 9OAUCsLQusl3TdiR3d88+uTrbVkQyn/WZqE8MV2AK04PWcoBN7f8RWQgbdHfRarWXW1W f8SEyWQtDOEy3CL/+Xch3/k2OOcCL+yFBPAS+RXhY+zExARR4JO+mf0bzRph3ov8ziqF v+nwXxOEyI2D5BtBB6XA4Mc0gHZ+PlPb49Om3Xia/SHLKGTvTGvk9R6ZTmBW3bNbTEIM scwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355047; x=1684947047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SealYxV1P0U6WM8/BkNmOSbeoydiMVThybk/G9EJ+VA=; b=Pm1nSOpWswzWgCN3tQCeh9uhKEff4syM5vNPRpoBXU1gQPGrGYR1rnIsVcTJolGUQ7 JMBrsMJxGeIIOMK2GhAU1plUGndM3Uyab+YPJXr5EpOYZ3tL7fpcitzts6YjBbBJBdyO nY6f5emriC8k7plg0k7PZvXOTeiJfisoXg6uL5FtD7jA3o7GK60nYbuu58jD4d1LYjuJ PErUTeb2XWj30Ob/2TrCYDM4ZAVYeF8RobGIHoEZ1ag/5pxsLBEgBUBtJeYiVVq1qZzG sPKmD6VG8hzDhfiINn7pSWvfeDsYowLvmvSioow5llx6KYZSG+SdLq1y3jpPvalCsLjf BY2A== X-Gm-Message-State: AAQBX9fGVFsblrh///d7T9WfbuDUx7LqC8PnGn+o1QHuZcQcUNhIXASA DCIdSuQ94uTgcZSMBSFfbCu7rodgjws= X-Google-Smtp-Source: AKy350YWp/IqIYFygdTWNIZZaD+6aBGQ4u/NPWgUPbTKSWEmlbkGw55a94RmOb2vlOn5tem8IvAfPQ== X-Received: by 2002:a05:6870:a70c:b0:187:78db:feba with SMTP id g12-20020a056870a70c00b0018778dbfebamr9541157oam.59.1682355047729; Mon, 24 Apr 2023 09:50:47 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id dk10-20020a0568303b0a00b006a60606de62sm4759279otb.52.2023.04.24.09.50.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:47 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 04/15] version-gen: simplify v prefix removal Date: Mon, 24 Apr 2023 10:50:30 -0600 Message-Id: <20230424165041.25180-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There is a much simpler way. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 0d00fa3d9a..c0f6bb242f 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -33,7 +33,7 @@ fi : "${VN:=$DEF_VER}" -VN=$(expr "$VN" : 'v*\(.*\)') +VN=${VN#v} if test -r $GVF then From patchwork Mon Apr 24 16:50:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222424 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60F9FC7618E for ; Mon, 24 Apr 2023 16:51:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232226AbjDXQu6 (ORCPT ); Mon, 24 Apr 2023 12:50:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232187AbjDXQuu (ORCPT ); Mon, 24 Apr 2023 12:50:50 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E3AF6580 for ; Mon, 24 Apr 2023 09:50:49 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-38be107e467so1572018b6e.2 for ; Mon, 24 Apr 2023 09:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355049; x=1684947049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UQcKAEYzHB9sfB9/cYFsqe1sV8FF6PP6yTX0Z7OGj9A=; b=O8drfHWH3ZT6AEeBYGaJnVvw61q0sOeXi1THsbssfMSJRICWnIcLnfY+PmkHZm9XZ2 tnJ1Wen+fOPuDoVZi880ozaXaJ9i76PAe10wgYfaAK/qy4tpFK+KZkN72jHW+VWwhD4G 1ENfN613I/UBcbq7Li5xePCskkrKGphjhmw4A5pdL/wSrfEqTCk+NwgFOqyN+faL4ehY tkdpGnatfSzTS+vWFrj/BJUbJAq47Kl7+J12feNX1ngUBlvrPO73ekYJsBMzxKzTqLHV 9ET+vGviFcyvk4DB+KSwiXo9HJ+WRiIUzWA7IkoUo0+HmiRKVY3ILzUDtHAYzxZf6ee3 UqUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355049; x=1684947049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UQcKAEYzHB9sfB9/cYFsqe1sV8FF6PP6yTX0Z7OGj9A=; b=VVFg8mKIU7SggU+2wGzBMEmcddqY0gk1FxVUvlK0hgWs9Db1on47gL+DZikDZA6L8L MOB8kLSq+Tz6tZ3EWqKEptsdxAtfZiSx+QYumf1iCFcFE5FwpsEhaXqbJhvH+mNkn4P6 oDhulrYyW0ormZKDFPG0LAfy7K+RZkxGhvs5FCVyvPN961FvXGoQAPRBBA85vWAQ4EdT Mcx5A7dSAglppqYeZm38vzkb2dK28rejALBP+KEfRAXpxORK3A3iakOVdC+jJz7gh7Bx 9wE7KQve9cGzhvDXAHQ2YM5RGNDuxjNl0qjWQ4jxoG3oQThbC9mazjidPAm0j5uPMOYr CiIw== X-Gm-Message-State: AAQBX9d6O26xcFjCPQUBaLA6U7sEW686Z4gKLjupR24wwWmkFcVpG897 1sgKThX2zRjXWcwxawZtCgictBE8fRw= X-Google-Smtp-Source: AKy350agvYyJ4S+Kda8cU+dR8XkswMu0NgMTTOr7My8Zc0jZKrtlxuQJhs7q710FWDGGDEh+sDC0YA== X-Received: by 2002:a54:4488:0:b0:35e:9090:2969 with SMTP id v8-20020a544488000000b0035e90902969mr7427299oiv.13.1682355049024; Mon, 24 Apr 2023 09:50:49 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id i204-20020aca3bd5000000b0038c235e24fesm4706632oia.48.2023.04.24.09.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:48 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 05/15] version-gen: simplify update check Date: Mon, 24 Apr 2023 10:50:31 -0600 Message-Id: <20230424165041.25180-6-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We don't need to extract the version when we can compare the whole contents. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index c0f6bb242f..34f561752b 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -35,11 +35,5 @@ fi VN=${VN#v} -if test -r $GVF -then - VC=$(sed -e 's/^GIT_VERSION = //' <$GVF) -else - VC='unset' -fi -test "$VN" = "$VC" && exit +test -r $GVF && test "GIT_VERSION = $VN" = "$(cat $GVF)" && exit echo "GIT_VERSION = $VN" | tee $GVF >&2 From patchwork Mon Apr 24 16:50:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE584C77B61 for ; Mon, 24 Apr 2023 16:51:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232228AbjDXQvA (ORCPT ); Mon, 24 Apr 2023 12:51:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232200AbjDXQuv (ORCPT ); Mon, 24 Apr 2023 12:50:51 -0400 Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D14F6590 for ; Mon, 24 Apr 2023 09:50:51 -0700 (PDT) Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-187d9c205e9so3317141fac.3 for ; Mon, 24 Apr 2023 09:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355050; x=1684947050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ikrhh7WqtiNmt86GQKZ7af/kse4hJbj5Vl4CEjNhjbU=; b=PwsgsdFa8DO9E4wWqxxGltZy1Z+DWhaI+TRhfZCh2T8lQdiugP4z35uLSnTztFYvct 6g+PDHfeWpsfDivb0r4eLBckjvUQBZ0p4HQvWSukUtGMoKDkqq12PKKIuq12PWopFzAh UM6Sb9xUrfBbjygI3FBrbo+004YZRLIHKMptLuCHdwEGBuI5mjAw+vhqwrX6QBjWXmHS AC+IPv3qVCe9MAZEAvfx0iFIkmTTnZdcx0hFs6Z9Me50imtl6mFVoYyF5qLwpYSs3NQt sqn3nzAtycuO4vIfzJYG13xfEByia0MpXcYErFHPvW9qNvmDhzYKTQ5RNHXJFs/54Zfn QebA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355050; x=1684947050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ikrhh7WqtiNmt86GQKZ7af/kse4hJbj5Vl4CEjNhjbU=; b=YG56em/k8L0rbZgn/N9V9KFDFU7czTLunP5UTFWD+t00EMoc5rgEb5Sx+u66NvrU3p 4wVh+/5o5yk/OUcdkFV61swWG3TtBK4CfcCaeRxDJSmp/txDV+3lAYtMNDGX4CULhAoE uJY5uMq9DtwKiY/lXA0ws0B+oL2YyjI1hJVE2Nvjqi2PEJ53sDykCgGTE+xHI2GDGcTD la8rKUiKMZYUZUv0OJZKtRTPXeJceb5t6x9fO/MOwaaW53GGiJMUctax6G/Wa2QLNYCa SQ0gkwSoL7Vy2HguhkdohNUa7ygtJvdLQpou3Fl0lNsJH+SyvFoGJWIlpuWWYORkwwWV 8Cnw== X-Gm-Message-State: AAQBX9ew577TRaZsjpwtCChevWXVTpZ9XZXk+apDXkkzy30amL9M/clE eY7lBYrBdPHH1zW+nVtD9Ju2jyzpOtU= X-Google-Smtp-Source: AKy350beLL8GJCbZ/j+2fiTI0rGXmfUNgvKQsZJ5qZsQznrsx5AcFAgpcd8lBz7dIqPMArwmyoz7Mw== X-Received: by 2002:a05:6870:214:b0:18b:1d56:b846 with SMTP id j20-20020a056870021400b0018b1d56b846mr9709808oad.48.1682355050371; Mon, 24 Apr 2023 09:50:50 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id v68-20020a4a5a47000000b00541b5963069sm5061985ooa.20.2023.04.24.09.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:49 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 06/15] version-gen: simplify `git describe` checks Date: Mon, 24 Apr 2023 10:50:32 -0600 Message-Id: <20230424165041.25180-7-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org How can `git describe --match 'foo*'` return something that doesn't contain 'foo' and without error? It can't, so no need for check for the impossible. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 34f561752b..e99c7b45c0 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -3,22 +3,11 @@ GVF=GIT-VERSION-FILE DEF_VER=v2.40.GIT -LF=' -' - describe () { VN=$(git describe --match "v[0-9]*" 2>/dev/null) || return 1 - case "$VN" in - *$LF*) - return 1 - ;; - v[0-9]*) - git update-index -q --refresh - test -z "$(git diff-index --name-only HEAD --)" || - VN="$VN-dirty" - return 0 - ;; - esac + git update-index -q --refresh + test -z "$(git diff-index --name-only HEAD --)" || + VN="$VN-dirty" } # First see if there is a version file (included in release tarballs), From patchwork Mon Apr 24 16:50:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98ABAC77B61 for ; Mon, 24 Apr 2023 16:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232254AbjDXQvI (ORCPT ); Mon, 24 Apr 2023 12:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232209AbjDXQux (ORCPT ); Mon, 24 Apr 2023 12:50:53 -0400 Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97E606580 for ; Mon, 24 Apr 2023 09:50:52 -0700 (PDT) Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-18ebb77aecfso3190463fac.1 for ; Mon, 24 Apr 2023 09:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355051; x=1684947051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sv2nRUzNufruoqX5pYdeG5WQynfGoX1AsevpHpBoq5k=; b=k3m4C1k/emVkVXshO2OZh7OYHqZBzAed5x0/q5dbYsyfQtUjZul7WZ5IXI9eGPZ2c8 el0gbzgBn/QAFTcXrtf+SZeT+K51vVMITWpJB5YaPjpWG0f71bHjoyb95bSXWbfNqw41 kS25S8a+FHC/DopOaMG0U23UKoZT22I4wxJKGIT/dwHekfMX58k3EwEPtS3jfRtruUDa 6roT7sd5vVQc70m/MJW0WPKiHjC7J+flmYK9umx46sPOlQhPio6kzMMvpxxr5yY8TdBn nwxUXGG9b+8GMsXn6A7VRb/jgAxZEVqfgCOZMAwLX2b0LcNhE1WEa+9v14oL9OLM6Fn1 avvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355051; x=1684947051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sv2nRUzNufruoqX5pYdeG5WQynfGoX1AsevpHpBoq5k=; b=gQ7BNiiVWCHGjMiFP9zXNSBwOyBQ7jnZXsyRHpYavc6LvObbKHhQMsLPJcXWbGrIHP blQPhOaOCNDBgUDOeIJBiRoYCSaPx850G9ERwduKtwOHBornE29o7kz8HM7nKgobGRiZ 30jtgTm9veecxBiKJ3GPEm6XfV4/nVwBQDhk7+tc4eJiNioJeo2Pst2aq4/vTGoNbI7i ZY1T/lWuEp4PJ8+OeTj7HsBs3g36QL6HUEcY0jNcN6uKy664IDodIp3QopCGf/Qyjih6 KR/eR6lLcSsxqgxwovU+gYiG3iVQ3yYDY1nZCaeTA6I2HQhlPLt0m/+ZaAAAT3sPXsTE tPdw== X-Gm-Message-State: AAQBX9em4a04U1sJkgLEjEG02LkV9Al6goVMSOYPehHCJAeOyGzYDLhK vJ1isvtAhh/Ib+M/guRVTPnBD14XcJM= X-Google-Smtp-Source: AKy350Zvfc3FzCHhqvuIWVB9lvTfrsoV8TR/pmwv9dsNiHWCGpFJ+c6nLC+PG6yiuSBrbMHJHpePLg== X-Received: by 2002:aca:f1c2:0:b0:389:5120:9506 with SMTP id p185-20020acaf1c2000000b0038951209506mr11058953oih.8.1682355051604; Mon, 24 Apr 2023 09:50:51 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id z9-20020a4aae09000000b005421d52de9csm4944156oom.45.2023.04.24.09.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:51 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 07/15] version-gen: simplify dirty check Date: Mon, 24 Apr 2023 10:50:33 -0600 Message-Id: <20230424165041.25180-8-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index e99c7b45c0..8edaf8f335 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -4,10 +4,7 @@ GVF=GIT-VERSION-FILE DEF_VER=v2.40.GIT describe () { - VN=$(git describe --match "v[0-9]*" 2>/dev/null) || return 1 - git update-index -q --refresh - test -z "$(git diff-index --name-only HEAD --)" || - VN="$VN-dirty" + VN=$(git describe --match "v[0-9]*" --dirty 2>/dev/null) || return 1 } # First see if there is a version file (included in release tarballs), From patchwork Mon Apr 24 16:50:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00ACEC7618E for ; Mon, 24 Apr 2023 16:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232200AbjDXQvL (ORCPT ); Mon, 24 Apr 2023 12:51:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbjDXQvH (ORCPT ); Mon, 24 Apr 2023 12:51:07 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 207FF975B for ; Mon, 24 Apr 2023 09:50:54 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-38e975c853cso882397b6e.2 for ; Mon, 24 Apr 2023 09:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355053; x=1684947053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IDGZRg+9mhMB8924q58ConnpTrIxmBNlQwQtW0pIlqc=; b=kJVkoYWG+odKxMmYZIhZ+eSbq3+wVzd+xXEKk9GDBR/oo1vuwKxxej2gLcF2ZsL/xZ DCzoKBjo4eUlZVfhrhDlgvHmWGaajfPpjL9xamo0YAukX8nyZrjsFcKaz2SpbW887bhi uLdrivHsUhjke2wtiqTfaci8LXTnuGp/SOMjiwUmMuyjNp/bvuNL27U5esX0Zx5fOknt 33VcZWI4kZlaq5rsxLNnwZ4Tb3F2uZ5OxedkQ4z5NHWZbXExgA8NShML1AfN8ARdD5jD FEon4yEu9aOV1RxKZKLwFppPnHC8Xo0Kwvt6ULeSvYeCcwBFdHhBoQak2wq+EO/rX6js B9OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355053; x=1684947053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IDGZRg+9mhMB8924q58ConnpTrIxmBNlQwQtW0pIlqc=; b=Xq9fijQ+BI1RCZkIuq9oQRIrlRmNHouhbXpNeHWA62VHgCFjarkzDRDR9aF78G5pAS C5EI+i633iwoUbhsJ/Uo+PdpzJEw5DDjRbUUYDdDFghsifPDDzGoPCrjRkcmZmd76Uql /k8vcR1MtUzs6MTb5ambW7vvIHMH/DLfbebEYi5w+pk59m38XKbYsYiL5QjqScPKq5V6 vItmgf0ogmOCzUFKee5EYJtyKNV/GA7L3Ky7J7f7IABsbxIDvHlqPSAKdwOFQMMsYxGq srGcnTlgz3wF9paXSQWcmFHNpwvTlgI3r3ByAM24CPGJuEfJjmYDd11RMjl1EotaaCDM uboQ== X-Gm-Message-State: AAQBX9d3PzDj4MQgSZjOmDQCs1w0d8JmyFNpO80/JOaCxn8KW2VHA/aV X+My12P9CaKHkPLykobCkgDGzZW6eVA= X-Google-Smtp-Source: AKy350bwxzhk0A0XUvRBeH+6/OH8b53Bj0mMt+DC9nszD1YdJGWo5tlGLcXehu6vk7Or7Qep3sLogA== X-Received: by 2002:a05:6808:4f:b0:38c:a20d:d376 with SMTP id v15-20020a056808004f00b0038ca20dd376mr6878061oic.39.1682355053035; Mon, 24 Apr 2023 09:50:53 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id k205-20020acabad6000000b0038934c5b400sm1425904oif.25.2023.04.24.09.50.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:52 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 08/15] version-gen: move describe fix into function Date: Mon, 24 Apr 2023 10:50:34 -0600 Message-Id: <20230424165041.25180-9-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 8edaf8f335..7a7a7fc591 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -5,6 +5,7 @@ DEF_VER=v2.40.GIT describe () { VN=$(git describe --match "v[0-9]*" --dirty 2>/dev/null) || return 1 + VN=$(echo "$VN" | sed -e 's/-/./g') } # First see if there is a version file (included in release tarballs), @@ -12,9 +13,9 @@ describe () { if test -f version then VN=$(cat version) -elif test -d "${GIT_DIR:-.git}" -o -f .git && describe +elif test -d "${GIT_DIR:-.git}" -o -f .git then - VN=$(echo "$VN" | sed -e 's/-/./g') + describe fi : "${VN:=$DEF_VER}" From patchwork Mon Apr 24 16:50:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 159F6C7618E for ; Mon, 24 Apr 2023 16:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232279AbjDXQvS (ORCPT ); Mon, 24 Apr 2023 12:51:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232255AbjDXQvJ (ORCPT ); Mon, 24 Apr 2023 12:51:09 -0400 Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60E157EE9 for ; Mon, 24 Apr 2023 09:50:55 -0700 (PDT) Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1879e28ab04so3777261fac.2 for ; Mon, 24 Apr 2023 09:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355054; x=1684947054; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v2iR00bnA59Xj6bxspElbeQgjlgKvCsX/8CO+PU6fcQ=; b=oLr6J49wGFnBQ/De+UjNplj96u3EySDW1JPiPPZg7JGp/OB4Q6ygE/dUmyzL/7S1T0 2JW/oNUPcfSWR5c41emlW57tE0onyCmjUR8uTGyG0tMt1tJsjIxAUOxAC3IkAab2lvb4 KbYpO+6pGfBDSUi+TAWPGbZZTwRuYxtzBuUfLPTa1LCqBwxh9BA6xyHbGFjkVVCamJl6 s2tA8Mo84h1gfHO+REEsyHKvcXNMF+3PfFAEN1dk6p6uLMF627XIr/HYeNwnyQYZn+Nf dag/17BOdIkqeAUGhW2COTJwTs3B9y5PCIs5xa+iTqY6dRB4vqE1gGbNNAin/RwwGGv/ iXpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355054; x=1684947054; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v2iR00bnA59Xj6bxspElbeQgjlgKvCsX/8CO+PU6fcQ=; b=W7D3okHIluU1k86NBUWUg+QPhmj7oesoBXQrtl/w88I7VTDaezQQFRF82wzF7D6QYa hZPeC3SSWEZz5nvo40nxioR+BruDQ7KDMFaAdLg2BfbBeLQvXEavmgTGtrmfvenq/Ypw NLOpvn/teIcLagd6nayWC8Ao4cQzGyQFt2Hy5mJ0fshFvyku0hUAXatTSjhaom/QR3FQ WS5rSNMkyLhl13NYfhMCTEj/jU07N2IUl9cjb332B89aZ2IBdG36lt7uxpVSYtSHDDrh Oyrx9AAkUOX2r8wsKZks8261V6TG+0Pixtj/r3A6gtcRkYPYURj6UE2KSxYy9s8nvHCc 3mGw== X-Gm-Message-State: AAQBX9e2vm3/K6vC0STxilo5gZP4TDjwyrgMeRUhmdsYUrlsro0qeY6q L8fJdzibQC051ZU947irykQ47lwrscQ= X-Google-Smtp-Source: AKy350YM4CQ32BuTQyVyFOoDIu1AJTGbX5Wa77kvE0BH0412lPTHPiPqWDw0gi3LA2ZKShZApeHbJg== X-Received: by 2002:a05:6870:b292:b0:183:cc50:f7e2 with SMTP id c18-20020a056870b29200b00183cc50f7e2mr9399847oao.49.1682355054348; Mon, 24 Apr 2023 09:50:54 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id u2-20020a05687036c200b00177c314a358sm4644525oak.22.2023.04.24.09.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:53 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 09/15] version-gen: describe and sed in one go Date: Mon, 24 Apr 2023 10:50:35 -0600 Message-Id: <20230424165041.25180-10-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 7a7a7fc591..c5265cf9ad 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -4,8 +4,7 @@ GVF=GIT-VERSION-FILE DEF_VER=v2.40.GIT describe () { - VN=$(git describe --match "v[0-9]*" --dirty 2>/dev/null) || return 1 - VN=$(echo "$VN" | sed -e 's/-/./g') + VN=$(git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g') || return 1 } # First see if there is a version file (included in release tarballs), From patchwork Mon Apr 24 16:50:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A3E4C7618E for ; Mon, 24 Apr 2023 16:51:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232288AbjDXQvV (ORCPT ); Mon, 24 Apr 2023 12:51:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232234AbjDXQvJ (ORCPT ); Mon, 24 Apr 2023 12:51:09 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1253A9762 for ; Mon, 24 Apr 2023 09:50:57 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6a5e2289965so3899161a34.3 for ; Mon, 24 Apr 2023 09:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355055; x=1684947055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bNTf+ktL2dkdthZk78xsIda5Ny7bBME1izzqdqpt5zo=; b=mJG//rhl5Wc2FZFVXKjTBfOx8v9GHeESG3GPKAjOBfuWgDjWFC5u0/a2cmtqlVuHBd 2sHgARTpvQYU6T/Ink6nmoufR0Bi4+UMmgnqGtZIYuvJkVmEYJsOLGpEM3ffv9XAXXwS M6W4Yl/P9KLPRAyvrcWEaknm0+R+78+NX/o0W+YvBJ0E4mUuZvJNdIk5UVhCFYbhpv1g E5JfGhUZZmn0yCjL1RYfaUEzxXEczu9PefRPl0ZuLRFsqRC3wriaaVm0+wyTmsvdX2dH /9fvEqOXVb+QLt4aU+f/ZT+9lF06q41s7lH+Z+/eGCNhxrCF0S4n6PuiexiR2L4caPEx ouYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355055; x=1684947055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bNTf+ktL2dkdthZk78xsIda5Ny7bBME1izzqdqpt5zo=; b=V92MhFV4Gn6Ou8KUIuXswBP/whRqdvU/gZydrFU0BnfeLQ4crhMBkWABDVmR2oUzB+ 4xkF/QOXSa1g+rGZCrD9ccO6h4Z3rTxDBPXokeS9z/pt4ZfqnCMqz2aSHLfwLGUbdKss REAKpuAxaP3qKCTTQLAP4II7k/F75iBJXh5Zj6rKduzsy75eY0rgwyvFkPB7tnR8Q3ZL hgITTqL2ibh8d8A28o0bYRTIac+xq2+0CeQGMSOD4UqHcfq3FQRi1bpenxF2+sFEnQUX TDNFmt/5Qver0eumxt0mswEaRf+GXTz9dHPYRK442G4ngzxLaIew7lNnpp9W4MI8eqVj xyyg== X-Gm-Message-State: AAQBX9eInqfYeZFteLrM2hJYtw0hK7Z2GiKmq3LbPYO4/SBjDqnIEn2V Xslz5DOK/hzrnd1QAEXkq5Qq8JcQJE8= X-Google-Smtp-Source: AKy350ZNe0iMUbqg7BiY7SBo2mI+1j1n2Q2UDEg9Hwh7/jf2x+FrDrtQKTPGPlOQLhrgFvdXV+/NTg== X-Received: by 2002:a05:6830:1195:b0:6a6:5a48:1f9b with SMTP id u21-20020a056830119500b006a65a481f9bmr2622918otq.8.1682355055687; Mon, 24 Apr 2023 09:50:55 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id o21-20020a9d7655000000b006a30260ccfdsm4801910otl.11.2023.04.24.09.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:55 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 10/15] version-gen: refactor describe function Date: Mon, 24 Apr 2023 10:50:36 -0600 Message-Id: <20230424165041.25180-11-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org No functional changes. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index c5265cf9ad..0eaa813cca 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -4,7 +4,7 @@ GVF=GIT-VERSION-FILE DEF_VER=v2.40.GIT describe () { - VN=$(git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g') || return 1 + git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g' } # First see if there is a version file (included in release tarballs), @@ -14,7 +14,7 @@ then VN=$(cat version) elif test -d "${GIT_DIR:-.git}" -o -f .git then - describe + VN=$(describe) fi : "${VN:=$DEF_VER}" From patchwork Mon Apr 24 16:50:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 775AEC7618E for ; Mon, 24 Apr 2023 16:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232291AbjDXQvY (ORCPT ); Mon, 24 Apr 2023 12:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232239AbjDXQvJ (ORCPT ); Mon, 24 Apr 2023 12:51:09 -0400 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DD1AA275 for ; Mon, 24 Apr 2023 09:50:58 -0700 (PDT) Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-6a438f0d9c9so3730181a34.1 for ; Mon, 24 Apr 2023 09:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355057; x=1684947057; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FQX6LIbnw1CWCYBYW9kF2fMJhM0mHPuKXGj1IEdnRJM=; b=VBAI/20Qm5M+WV0GAWeofuAtzIUyZxOO8TbMITMReG/R/bNGqNV0FoLZ7GRr13QVKG TRpHWLIfPqFoMCTb/MBNRoe2hK8W7tKuASRU8oKUlOaccP18LbYH7ic3fw0hHP5V0Ei4 j6b1EpYX7oFq1JeqaaqiFgPaYstYnorcXl215pxHITvpB7CuW86bl+CstIKFZD5EGtsQ umf7g7/7+KnkRqJJjB5VBL/g28g5rcO8UUgaCeeTRvkLx1HYmvENKNOjjgLbmggfMTqg Xxg7LUWQtC9fafMIzbQ0QbOVcCo5N8dLis2HZX4fm/KxyhxFTPvEVXlGSQcA6ElQ5b6P Hwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355057; x=1684947057; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FQX6LIbnw1CWCYBYW9kF2fMJhM0mHPuKXGj1IEdnRJM=; b=KQc+LNCP+BCALTUp9jGjjGE3bmoX68OMIKgXFxJloYQuJ+CyEZhkecUIEHF2DuPaTH 74tvkSTpjUNUVX19fdeVJg0FwyS9ZRzYQqfW8VUx8IQPrrB0jxuyMIWzs3cIa3cqHfP/ ULPVbitxUhBn8tQ4ajCn8yemd9L7pYt93+X4DkXTiisGZPrNqPPsItYQm7MgNdpELbRF GnoVpZv2ddJFtTSqRPiFyfzKP7o2RTE6lCCdgvPvAL+gPCdKC+Roh2VC+nZkrExz8kES ZGGqd5G3v76PKUrpsfjD8aV9nw3jmLx3N19UBuRtFmU5p2zlQPYEFdf9GUPRn/PSGR7w YgWA== X-Gm-Message-State: AAQBX9cYjwCM2AUrO9Vftph6AJi4uQFh4KenS5dD6Bv0ehtLBIEa0oPm ynteOlYmQOtVlHFzfsyKlE+HGkNbA1o= X-Google-Smtp-Source: AKy350Z6F3VtNhTbsJvLltPpBOYC/Hs7PBgbNdD3BzuCKfeE6QslrZTcUECQ6KCLAI1JdATAzP7erA== X-Received: by 2002:a9d:76c8:0:b0:6a2:dd75:1791 with SMTP id p8-20020a9d76c8000000b006a2dd751791mr6706380otl.7.1682355056950; Mon, 24 Apr 2023 09:50:56 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id e5-20020a9d7305000000b0069f9203967bsm4758695otk.76.2023.04.24.09.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:56 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 11/15] version-gen: do v fix only when necessary Date: Mon, 24 Apr 2023 10:50:37 -0600 Message-Id: <20230424165041.25180-12-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There's no point in having a v in the default version only to be removed. The only time we need to remove the v is from `git describe`. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 0eaa813cca..40502363dd 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.40.GIT +DEF_VER=2.40.GIT describe () { git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g' @@ -15,11 +15,10 @@ then elif test -d "${GIT_DIR:-.git}" -o -f .git then VN=$(describe) + VN=${VN#v} fi : "${VN:=$DEF_VER}" -VN=${VN#v} - test -r $GVF && test "GIT_VERSION = $VN" = "$(cat $GVF)" && exit echo "GIT_VERSION = $VN" | tee $GVF >&2 From patchwork Mon Apr 24 16:50:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EB6DC7618E for ; Mon, 24 Apr 2023 16:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232267AbjDXQv2 (ORCPT ); Mon, 24 Apr 2023 12:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbjDXQvM (ORCPT ); Mon, 24 Apr 2023 12:51:12 -0400 Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CB95A256 for ; Mon, 24 Apr 2023 09:50:59 -0700 (PDT) Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1878560f69cso3329687fac.1 for ; Mon, 24 Apr 2023 09:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355058; x=1684947058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KXkHT+ch50NMOJnl5ZeXy+PF4WNdISENyavN39eTFjc=; b=j9KkJd974t2LUrYJfGX5gY1U1nCHHNpDhOikA7e7J92sxILkonu6ZjpdmccgMMmvTs nWq1ADBz+nYOvXvo0HN3w1nuOel55CELFevj7ksb3WNzyI85EyAuxmYM9RVhIuGEkS6Y lRjX5+6/pDMNbGMhwOBaMCjFBP2vj8rAYQkl/N1SRsx8jyD2hDCrLzYgiyf7EZf7DJd2 NrxJPAB0EYZYqJxm5x+6fI+dQH7ZTZ+fYNEqJRVJNZSWAIKEE0lvHytEYnG47SJM29ni ppNPzrmmAdomcHKqjwQ38/pBjsaHbNVb1U5EBS76VQsUwgQQ14UlmSAtOzBglT5Iea+9 s+eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355058; x=1684947058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KXkHT+ch50NMOJnl5ZeXy+PF4WNdISENyavN39eTFjc=; b=AKpHdM4yK6ISiISGEVenNB26ffJ4Vh3SHplvPyjJMbm37cwDmsNlKiJF+cuW7YcpoV RAMQM4lup4m3Y4Xaf4oB2sQUzFFk0t6coJHR/KZ5LRCMy5JMVfrhiuAcLEgJd60bXr2W fK84kR5SlV4j9lvLIOwuaBgDmg/O5qR5NzinSLwHNTssV5M8Gb9txlpSyucHZ5T1ia42 HQf8P5/6l5BUJmkjUlrfXIS5vmQHDoWPPaGumUjrdJPssnHN4N5PtM76aXzyNiUPyvyA QtEIHn7+5wgtjIHd3qcJQBIVbzaIDrfHEVcSGVNgQH6CQUZ6uwf/3COV3UlmFIl4O96x 8YSg== X-Gm-Message-State: AAQBX9cxtJQIfFSm1K2lyOkTFvxguR5+5kMboKTzqH0P00gIkKYSg1It hLB60VoDCyd3l5QY9HnmL7Ti8sfRi7k= X-Google-Smtp-Source: AKy350atzgOqJfMlfeA6Fi/DYcUG37eSqfvNVXRCg246xPlx6uyD1qQC98HXirV7Mi+lZyVucKDoNg== X-Received: by 2002:a05:6870:c191:b0:17a:d2e0:1a18 with SMTP id h17-20020a056870c19100b0017ad2e01a18mr9420461oad.43.1682355058203; Mon, 24 Apr 2023 09:50:58 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id p12-20020a4aac0c000000b0052005fd50a4sm4972549oon.35.2023.04.24.09.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:57 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 12/15] version-gen: move v fix into sed Date: Mon, 24 Apr 2023 10:50:38 -0600 Message-Id: <20230424165041.25180-13-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We are already using sed, might as well take advantage of it. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 40502363dd..6bf932c281 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -4,7 +4,7 @@ GVF=GIT-VERSION-FILE DEF_VER=2.40.GIT describe () { - git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g' + git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//' } # First see if there is a version file (included in release tarballs), @@ -15,7 +15,6 @@ then elif test -d "${GIT_DIR:-.git}" -o -f .git then VN=$(describe) - VN=${VN#v} fi : "${VN:=$DEF_VER}" From patchwork Mon Apr 24 16:50:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA7F3C77B61 for ; Mon, 24 Apr 2023 16:51:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232234AbjDXQvi (ORCPT ); Mon, 24 Apr 2023 12:51:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232284AbjDXQvT (ORCPT ); Mon, 24 Apr 2023 12:51:19 -0400 Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F082DAD0B for ; Mon, 24 Apr 2023 09:51:00 -0700 (PDT) Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-187ec6a5504so3633974fac.2 for ; Mon, 24 Apr 2023 09:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355059; x=1684947059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3OBH7cOQDXJn+wAlJ8Gw9zkLtA6buVRqorS+OiGNl+k=; b=i52iLIXe81bFVvEQZUMDZChXydaFEhqk+ayb1Ibz26bmiQ4oH1B0VXuXeorrtBX5M1 iT5VGOdUQ51JnBjaUxDZ2B+qwncLeQt/Umg1A7HrcVsfZkvlwSbKpzjZEnnlmYoeWSrx 5mHDEYb60J8DWdRyNh3clxLytFU9vM0SfQFrusYapi7BaNmh4l4kiksyWqIeEkEyvRMN Kaarvu8y+YIf1ZUX59USkfg1O94tsv+JXrldZCbDm4dSlaFYD9yUgMlLlTCTwoxkdn5V KQQwHOElGDLIqxgoxfwEqkv9fniy7ocDnCJDA93GUrwwCRLdGakHt+eLqnyt/0u7lXWk 0lxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355059; x=1684947059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3OBH7cOQDXJn+wAlJ8Gw9zkLtA6buVRqorS+OiGNl+k=; b=hdrZys9BKvvoWQNZzFeZ4ELubk0xFkxrrqmyB9AgZsi1bRayrStNgfZKjNTTy/RKjN 0Hx1uV1H8aOKMCGc8CtDHZ+CtYSUPALc9w5867OqaveE0K+/j+RZ1iHd6lYYaWy54oJU IbQTGJY2Bnm7xT7fTJtWvUjXA/kFIouWdq3A2CYHJU1+/o/J94u6uyahwGcjJ8hifBpL yZitRhggqzHnP5nS8fo52jTovnU041DwtnkqFOQZRJu+2YzJ6njaM2o9jKbqsWGXlIy5 WVuV1pZ18koi+aPH5bJvaDc6/YUBA/Viz4bCrd9f0tHZ9VutLw6QWbxmKuROaWhrNrC9 Cc9g== X-Gm-Message-State: AAQBX9eqrTtWE1qaeNwpr0U6Q+a8dcVqG+TaqRqp2Yx4u4XgP9qCsmqN RLiXCyw4EII/uWzL4ShJpkIzmkixuQg= X-Google-Smtp-Source: AKy350Ya3KQjpmSqSnzNUE6hXRv3YIZPQIGNGazcoSQEAnJKNmFrK2+Qbip1frQ7Pi/FpSDD1KN+BQ== X-Received: by 2002:a05:6870:558a:b0:17e:8a6b:829 with SMTP id n10-20020a056870558a00b0017e8a6b0829mr9586010oao.52.1682355059609; Mon, 24 Apr 2023 09:50:59 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id bo37-20020a05680822a500b0038edc69490bsm1209462oib.10.2023.04.24.09.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:50:59 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 13/15] version-gen: refactor main functionality Date: Mon, 24 Apr 2023 10:50:39 -0600 Message-Id: <20230424165041.25180-14-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It's pretty clear that the `version` file overrides `describe`, so do it in one function. There's no need for the comment as the code is self-describing. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 6bf932c281..5b75cb4976 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -3,19 +3,13 @@ GVF=GIT-VERSION-FILE DEF_VER=2.40.GIT -describe () { +get_version () { + test -f version && cat version && return + test -d "${GIT_DIR:-.git}" -o -f .git || return git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//' } -# First see if there is a version file (included in release tarballs), -# then try `git describe`, then default. -if test -f version -then - VN=$(cat version) -elif test -d "${GIT_DIR:-.git}" -o -f .git -then - VN=$(describe) -fi +VN=$(get_version) : "${VN:=$DEF_VER}" From patchwork Mon Apr 24 16:50:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A9ABC77B61 for ; Mon, 24 Apr 2023 16:51:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbjDXQvm (ORCPT ); Mon, 24 Apr 2023 12:51:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232239AbjDXQvY (ORCPT ); Mon, 24 Apr 2023 12:51:24 -0400 Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6BC0A5FB for ; Mon, 24 Apr 2023 09:51:02 -0700 (PDT) Received: by mail-oo1-xc32.google.com with SMTP id 006d021491bc7-541b69cbe87so3719563eaf.2 for ; Mon, 24 Apr 2023 09:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355061; x=1684947061; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LlvY/gLWCEYjlHyoLi+mPQutE02K+TOVJ6CE8QhKHtU=; b=DIdUotC4uwRaAFj7cEP2Hqc5HKk+G64jRnSwnyOmDa5t5Jv/kI25ScMMx/MfPoORQ4 /HjfhA5D7El/D6dWSLRHpZTw56HUcfMG2+CEUFNEcb2dgZImDxgF4h0J1G0z9NIIiGRK Gd4CU5Q2YcexzD97VMDSjFAjG7WE20tcNuL/wl3BxOiT8hQAu1KwrTHph2h05+Hk8BST +ItuL1MO5FjyQYCCvv0990sGAIyNb515j8n1+Gg8uEIq1UkObBei2+HgpqC1IkLLpdNW kkQ0zvMQryEx53wkbq05qS5UpEcHd/pW9OsP9xL/e1qthht0uuV+EtXEa9uFpC64rms1 taEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355061; x=1684947061; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LlvY/gLWCEYjlHyoLi+mPQutE02K+TOVJ6CE8QhKHtU=; b=SNi42DJLD3+FTvQi9HXhOnboPXr/0UL++pHK7/FgEVzeD4kP3TBYuAjdrYp4XK0ExZ +JYKN/A+ZkyRtsnusaBE8KA0G0eTHW3seCpXJUXA/LmGy7E+um88KAN12Kn/Yzellz4l VGB/tCRv0jKeHNuxGChKFFL4pUNdWLkkaostj8hb1DRWAN5TwZHnMqSU5DiA78sXEj87 TaPmhC04Eiwx4JHLvM0/Ty/kKjVqHDomDr91YVVUzeEaBj2FYr8WhNmA8aEfLO3Pffwy uvn8e+zJ4OhVCmEo5ri1NKA319grSd9LwRJ7bF0vfsMbHLy34XOVa0J8jsa6Ku/9ujb7 SW4w== X-Gm-Message-State: AAQBX9cIaqYXf9ASBIrWwGS6a5R4SiV+3Sj5UfQbfjv9hK42V+zqiwHg K/QYSGfsg+TyUagqgkvPJCTErmTQJ0w= X-Google-Smtp-Source: AKy350YpFN+Ig4GEZgSdyZDXfUgIPeSDkc3rBZQue/qpj6G0yOWdx7vsLf5f5OgyLITwwV0V00XW9Q== X-Received: by 2002:a4a:dc86:0:b0:545:fb94:34a7 with SMTP id g6-20020a4adc86000000b00545fb9434a7mr5736312oou.1.1682355061561; Mon, 24 Apr 2023 09:51:01 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id k34-20020a4a94a5000000b0054156478f2esm5062070ooi.44.2023.04.24.09.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:51:00 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 14/15] version-gen: refactor GIT_VERSION string Date: Mon, 24 Apr 2023 10:50:40 -0600 Message-Id: <20230424165041.25180-15-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 5b75cb4976..a1c50cb06b 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -13,5 +13,7 @@ VN=$(get_version) : "${VN:=$DEF_VER}" -test -r $GVF && test "GIT_VERSION = $VN" = "$(cat $GVF)" && exit -echo "GIT_VERSION = $VN" | tee $GVF >&2 +NEW="GIT_VERSION = $VN" + +test -r $GVF && test "$NEW" = "$(cat $GVF)" && exit +echo "$NEW" | tee $GVF >&2 From patchwork Mon Apr 24 16:50:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13222434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CE41C77B78 for ; Mon, 24 Apr 2023 16:52:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232022AbjDXQwL (ORCPT ); Mon, 24 Apr 2023 12:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232301AbjDXQv0 (ORCPT ); Mon, 24 Apr 2023 12:51:26 -0400 Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 225E8AD37 for ; Mon, 24 Apr 2023 09:51:04 -0700 (PDT) Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-18b0879e0c8so3502707fac.2 for ; Mon, 24 Apr 2023 09:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682355063; x=1684947063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dgn6n2kCBKA8Oi48GTjtt8h1FvePhHI6E29EwGu2AFI=; b=jRGT8ETJr6GcEZFFpiOwAnUeJDCmulaX0C9cMROmvqwsZ8sqIToeJryIpBvXtzPLZ1 qhnPPGrW3/3FHQXQg7idD7Sosh9CwwaR2OwyfIW5SDffuwRTJEhrDTg8RwyJhoqlfttg OPJ9qacIIzvSKNR+Sa0BLNJ1WOyMf2PMm7PMN8xHfD+ivXGz94rYSDipDhe8kGVuTh1B d1Bn7d889Em9aVoZbq69J6Vfn/w6BuTHKR5Dgp4kyWpxaq/CfnF4wCAWYkOWpsRv78ry 5CUgfmnfzyFVFxqi4mXlQ/b3vKhxZD4FpMhl9slv4kwx4MnXGccNZUwSEjJU/+VrAQRI NmDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682355063; x=1684947063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dgn6n2kCBKA8Oi48GTjtt8h1FvePhHI6E29EwGu2AFI=; b=K3SylS7JuemhQjw6+16o9E6IV5EbqmZgJ3B2HHxXcth0mVF09Zl55mflk3zycY2ROJ ChkdrxONy1VfRFgonYqrni1feXA35f1XSGXlBaRCselDPKnCFm3+yV75CvfeNIpzOOA/ ACh7TpJ5oZTGXsDbcOun1rk3EYpnU89J/Vo0KvljcmhXIKI1VR/BU0rjsXwhP8Iq19go uCOO14s2zR33VpQ5qRE0GbSRbKl7VUyy3f1bZTHpeLxFps3kE6pr/yOtGMfB3PKqr/rQ gt8WMpQ2rTQFjJL01Sgu5AIHW1k5FNXWyKGd4yxbLGmDHCGx4XGVcaAJa75snevoOeuU xn5w== X-Gm-Message-State: AAQBX9dV3fWI2vQlO92Yn7JJOF4M9/tMstLjBoVkpWBkOReKdOVxn6Jw pIr3uzj+eqk0AzNsHx7hrTzKnUFxF1Q= X-Google-Smtp-Source: AKy350aHXdIWdZMm1/K1xX3adHWl4LEizxL17yqajl6foskq+FgEIpjZR+LTlv2NHYzl84pe5P557Q== X-Received: by 2002:a05:6870:8308:b0:17a:e1b7:ebef with SMTP id p8-20020a056870830800b0017ae1b7ebefmr8820403oae.12.1682355062806; Mon, 24 Apr 2023 09:51:02 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id l21-20020a056870d4d500b0018b9dc6acaasm4317750oai.34.2023.04.24.09.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:51:02 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano , Todd Zullinger , Felipe Contreras Subject: [PATCH v2 15/15] version-gen: get rid of GVF variable Date: Mon, 24 Apr 2023 10:50:41 -0600 Message-Id: <20230424165041.25180-16-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0+fc1 In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com> References: <20230424165041.25180-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There's not much point in a variable which is never going to change and doesn't really add any readability. Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index a1c50cb06b..3d30ce74af 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,6 +1,5 @@ #!/bin/sh -GVF=GIT-VERSION-FILE DEF_VER=2.40.GIT get_version () { @@ -15,5 +14,5 @@ VN=$(get_version) NEW="GIT_VERSION = $VN" -test -r $GVF && test "$NEW" = "$(cat $GVF)" && exit -echo "$NEW" | tee $GVF >&2 +test -r GIT-VERSION-FILE && test "$NEW" = "$(cat GIT-VERSION-FILE)" && exit +echo "$NEW" | tee GIT-VERSION-FILE >&2