From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8MsrO25oxGPX+wAAbAwnHQ (envelope-from ) for ; Sun, 15 Jan 2023 21:56:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MNjGOm5oxGPlGwEA9RJhRA (envelope-from ) for ; Sun, 15 Jan 2023 21:56:14 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E3F97BE2C for ; Sun, 15 Jan 2023 21:55:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHA1g-0004Vb-QH; Sun, 15 Jan 2023 15:54:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHA1f-0004VS-Cj for emacs-orgmode@gnu.org; Sun, 15 Jan 2023 15:54:47 -0500 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHA1d-0005eD-Rq for emacs-orgmode@gnu.org; Sun, 15 Jan 2023 15:54:47 -0500 Received: by mail-qv1-xf2a.google.com with SMTP id h10so18478813qvq.7 for ; Sun, 15 Jan 2023 12:54:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:to:from:user-agent :references:from:to:cc:subject:date:message-id:reply-to; bh=kMOqCyuu7hkNCkSL0pobu/GLQGzpE6pYPUlu4uChdNM=; b=DviTwWUnuqKWjacPqoDhfpyJlupuYH8FEuqm/of4QC4RjWV+iOaVVXxRMHmrFjNRl0 pcSr7zG+pjy/nJk9AW68zMMNJL2nkjq2CQiFtEQo5GoefAODmOdMj8gwiZYl3um2+x6r kFE2ZF4QEn0uaEDKY0CVVuOwfw8/mCw3YFGhhihGHPDa+TT6k3TDOFsR6Y8irLwU5vRz hIXkfSuh5R4Xfn+hRDnKgujj7h8t05twKVKGDG7Zq2dehE5wqGl/8FXVC6PbOa8foZv+ 7TqD+FD+R53/d9c4E3P3/Jg/eypsbCwn9ZWImYavVFvBMagAApzYm6nIidE+UMpLeNRx QF3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:to:from:user-agent :references:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kMOqCyuu7hkNCkSL0pobu/GLQGzpE6pYPUlu4uChdNM=; b=NzGQMZsU+u1iUEEvqMXJBsNxafnXe0azevdhZ9Lq5i4H8iksbsM5Vzlmb7RwOGAsbX 5Fodwzw5jtcVZQPLFe9se13Y1W/69RXYddtjaGKT1E8Xg3A+o5AsQj6f+rwLRuBqAIuq V/w184X4nqIlM2yoQ5SV256RPmNQGtK7TEl7Qs4aY9/nkrNdr0nnYsk9bRQmXnUZWNv0 Cy8gwmmTVw2YjSc05CqFmbiAb127BPlahsiJjoNH8spzePURBKOQX6CXQB0yicknEb0f pyV2owHJoPn2mjK3ngACCNVoFaeTXVDtuFk3w9NHucoA2gnfCmjFHvqNhabAWf03g2uY cUAg== X-Gm-Message-State: AFqh2ko2/MtUa/wsQQZidunFiJS7bDObAuKMEmTwTkETNCfGqTaTkym7 oT+ANGd+Wdd2BRsp1FwRj8bkTYEK7mA= X-Google-Smtp-Source: AMrXdXvUN+UGkVFnVQRjgvkvI5GfdDHwzSO2HjxUbEBs7UmZxJ4mKZ6G46USeV7sghVGYJUFVlyQIQ== X-Received: by 2002:ad4:4082:0:b0:532:32b7:b7e4 with SMTP id l2-20020ad44082000000b0053232b7b7e4mr35640905qvp.29.1673816084291; Sun, 15 Jan 2023 12:54:44 -0800 (PST) Received: from nbook ([2601:82:c200:166d:7a0:14e6:e26:75bd]) by smtp.gmail.com with ESMTPSA id bj3-20020a05620a190300b00705975d0054sm17022762qkb.19.2023.01.15.12.54.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 12:54:43 -0800 (PST) References: <87r0vvr2ai.fsf@gmail.com> User-agent: mu4e 1.9.12; emacs 30.0.50 From: No Wayman To: emacs-orgmode@gnu.org Subject: Re: [PATCH] Support building Org from shallow clone [9.6.1 (release_9.6.1-137-gecb62e @ /home/n/.emacs.d/elpaca/builds/org/)] Date: Sun, 15 Jan 2023 15:55:35 -0500 In-reply-to: <87r0vvr2ai.fsf@gmail.com> Message-ID: <87mt6jqzx8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673816134; a=rsa-sha256; cv=none; b=ItKLtR/5SRqQVgVkGNbPmGslAh1fWnXm8rk7Rnx/p8j853Y0RnyFJPvBQAKo/QeHBkd5Hk 1bXWrLGGFAP1QWgnlt9n7vdD94fAPzR9R4u5FiZLAC3Du7RA3toA1EMIX2y6Q2Az40eD1c 48FVdV2srehb466qDzxM8RyyafdeIGChDW9qnRDiurZt5rrhetTTRpARM0tAc8FCtRqY3H HWSA2yoSMloXqvPX0t5LuIYBeMBIOY3q2daaaOdgHGzctPLOA4RO7r5uzHzrGPhTDB08tb vDGWnUUhb8FZwWmtxQQ0r+mbnAevLDGCD2qZUIv/AjvLluzJDOfQfdzDw4+RSw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DviTwWUn; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673816134; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=kMOqCyuu7hkNCkSL0pobu/GLQGzpE6pYPUlu4uChdNM=; b=KIX8DYKLlVRxcxC4xA1QvR4r/FKB5pr4Rc6f/GbYuRQL9APenkI5u8aVGKPaW9Qg0gzIkk nvWMxRQwWrWScqvbMBVIE8PNhomdreKgUGEzOvb5g1peV19dLkCjAIPC0OT3Z3I97t1XEG togfe8PYvDvHEYtsgniU6Kz0uZGETbeia/DlkxO40OcXmzebuw7bFIdMzB7aWMld1o1h6f ByREp1L96qCKqx0Sg8xBT22tFoqy0n0NtSIfobxxZsXEcpVYGWMYvSsEPmKIj8/3MeE557 rDZE9iJSTZ1fCT9JGEh13Yt8gEkBsTgsasnvBaHljqwr6Ow3YYV1bPsTQcpy+w== X-Migadu-Spam-Score: -6.27 X-Spam-Score: -6.27 X-Migadu-Queue-Id: E3F97BE2C X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DviTwWUn; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com X-TUID: FWK5G8LdKIMw --=-=-= Content-Type: text/plain; format=flowed No Wayman writes: Sorry, wrong commit value in the previous patch. Fixed the patch attached here. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-mk-targets.mk-GITVERSION-support-shallow-repo-clones.patch Content-Description: revised patch >From a4cd70e17455894aec5d15d97eb41b56769e5cde Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Sun, 15 Jan 2023 15:44:45 -0500 Subject: [PATCH] * mk/targets.mk (GITVERSION): support shallow repo clones If Org is being built from a shallow clone, tags are not locally available. Query the upstream remote via git ls-remote and parse the output. Note this will result in a "n/a" indicator in org-version where the number of commits since the last tag is usually present. e.g. "release_9.6.1-n/a-gabc123" --- mk/targets.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mk/targets.mk b/mk/targets.mk index 4435daa9..20d375aa 100644 --- a/mk/targets.mk +++ b/mk/targets.mk @@ -14,7 +14,14 @@ ifneq ($(wildcard .git),) # Use the org.el header. ORGVERSION := $(patsubst %-dev,%,$(shell $(BATCH) --eval "(require 'lisp-mnt)" \ --visit lisp/org.el --eval '(princ (lm-header "version"))')) - GITVERSION ?= $(shell git describe --match release\* --abbrev=6 HEAD) + ifneq ($(wildcard .git/shallow),) + REMOTETAGS := $(strip $(shell git ls-remote --tags 2>/dev/null | tail -n 1)) + COMMIT := $(shell git rev-parse --short=6 HEAD) + TAGPREFIX := $(subst refs/tags/,,$(lastword $(REMOTETAGS))) + GITVERSION ?= $(subst ^{},-n/a-g$(COMMIT),$(TAGPREFIX)) + else + GITVERSION ?= $(shell git describe --match release\* --abbrev=6 HEAD) + endif GITSTATUS ?= $(shell git status -uno --porcelain) else -include mk/version.mk -- 2.39.0 --=-=-=--