From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 8JGVJJChxWNhNAAAbAwnHQ (envelope-from ) for ; Mon, 16 Jan 2023 20:12:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +Hl9JJChxWPfFwEAauVa8A (envelope-from ) for ; Mon, 16 Jan 2023 20:12:16 +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 90FFB3DBF4 for ; Mon, 16 Jan 2023 20:12:15 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHUtT-0000xE-Ix; Mon, 16 Jan 2023 14:11:43 -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 1pHUtS-0000x5-Gi for emacs-orgmode@gnu.org; Mon, 16 Jan 2023 14:11:42 -0500 Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHUtQ-0006vn-Vt for emacs-orgmode@gnu.org; Mon, 16 Jan 2023 14:11:42 -0500 Received: by mail-qv1-xf2d.google.com with SMTP id n2so4230049qvo.1 for ; Mon, 16 Jan 2023 11:11:40 -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:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=S2Fav6yPqi9FbaL4zazd0+sBRbf45G/TQHb/RD58F0o=; b=UpBZ0GSBMjFdFpW9sEMk1UYSe9tmIERPzDx9EpZxEWuASDSAfsOEyl8hyWsekL/J0c rP78YRHSIzIcFcytRlFpoMXGuXDZvp9S+K4EiQ31SuI/5Xq9RlnS650+nR3DUVHh/lRS yLxS3oLkKrBV9W+JL41yIlPkFcr8M9MdYMQB1ytW6avGOmJu5gMenrh+hf4WsRYfPMA7 l8XjukoJCwvf4C0PEE8Fao23+9XjM82cMNQgXB9NrIJ+aO2pyTf2dx0PYAMM+t05vzQm 101sBA6QLSLweIZg4+8NdKZn2B9DKWmSwCJ4PKWWs82o+V4Z/ukg1gwm4cdVNR6uGrVO 7R9Q== 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:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=S2Fav6yPqi9FbaL4zazd0+sBRbf45G/TQHb/RD58F0o=; b=RzjFpk9JZAAsVvdB75f1HzhsvKm6YG1TnPxiwCr2Hah7OfwOVEWDpZnjTpnRIVqJai OOgeBI9iRGvH2A132V+s63BgU+DqXtSJVkarV3GpAP1hQrKF7kd+GI9zpNvz47b15/JH p+T4hzBY6Sdy1j/RScYFJ2vk9ngzdcE2f0NnHeyJDA33X/E6TZDxB5iopFPHfi8K12Ow AuZQAANxSOtUU2uoyUI4zn8POMMTgff/8vDVchWmtyYvKuShNAnzE+LuYfE/u9pkcEDX jKJD6wuAcs2+Fj6F7zg4rtWK1wJAzogcAH03OKvCeTxR+sEjyihJy0G7SnmCibTLHbS7 aBCg== X-Gm-Message-State: AFqh2koZ/cuJO/YtKr+lbeOHgk9nRAg1olupJtiIj9/vSJuFhU+TcKcX p/3R3jfLE7uWOM6/BdQeg+XDWMa3wOg= X-Google-Smtp-Source: AMrXdXuUIL13JuG2KrdEAoCVgb0zuvWGkQJf5fPF4s4Owt2aegfgrtwT/xHTBsB+Q6Y0Lz8yoXRMFg== X-Received: by 2002:a0c:f10b:0:b0:532:2b59:95c with SMTP id i11-20020a0cf10b000000b005322b59095cmr50592009qvl.32.1673896299849; Mon, 16 Jan 2023 11:11:39 -0800 (PST) Received: from nbook ([2601:82:c200:166d:7a0:14e6:e26:75bd]) by smtp.gmail.com with ESMTPSA id g19-20020a05620a40d300b006cec8001bf4sm18946563qko.26.2023.01.16.11.11.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 11:11:38 -0800 (PST) References: <87r0vvr2ai.fsf@gmail.com> <87358alhux.fsf@localhost> User-agent: mu4e 1.9.14; emacs 30.0.50 From: No Wayman To: Ihor Radchenko Cc: 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: Mon, 16 Jan 2023 14:11:28 -0500 In-reply-to: <87358alhux.fsf@localhost> Message-ID: <87tu0q5m2t.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::f2d; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qv1-xf2d.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=1673896335; a=rsa-sha256; cv=none; b=GED+RSvfCrLy6B+QdnWo8VetO7YQHwveNuTo7s9XKN3JSKXiUSuBX4scIwOOYJWOpEnZEg eqwhR8aAMXLwVtYIyILU4N/DF3kZBOCoZQG6ombo+OQwVd0IemmnhDJDjAQZ082sEZb8Nv JuLVLx4yPN2BG86MJXuoV5jHaUQ0FQOIsabhvQZqhJOZPAPGIodL7LQoBtwcLV3y7PUTRv 4HP162Co3+Ayqu00yIiTIryb1GE0+/zGW+uCZgqLftGrqU4qSYPNjb4JHz1e2YMIvQhv05 cF9qaNIZrzgsSl7gmUjyBYCdACQEGSKv/JMiigcFrmwW3CVGMe3M5rCSEShhwg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UpBZ0GSB; 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=1673896335; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=S2Fav6yPqi9FbaL4zazd0+sBRbf45G/TQHb/RD58F0o=; b=XlCfPczXdiyWdrGh2fsLgrUKenlALQHz1YhvOWRh1EP0OlLzC46M99tfPetiJHFIJHJyvk EqIjeMkijeqrnT0yl1MDD9eqqT/2yZmjnStPIyBopLxMYws/6zmoRBsPgwcPFZj+6P8TBA 2Q4DuZHmCNxo2CGkGKyK/cOyuvWUk368OI+YsfXZdbBxuyiPwH+F6/GuNbO5FAA1LN+Q3h +5WqJlf+Hl4y/H9zGWiBWQehRkToi708McwTyqn+LDYKzZJJWSFTFmlGXhYVaPXz16qvMQ cbSlPVtpq90Vy9yO4GI/8e8Disvh6QU52ubc6g2/q0iOApq63660Z4ThRsDiPg== X-Migadu-Spam-Score: -4.78 X-Spam-Score: -4.78 X-Migadu-Queue-Id: 90FFB3DBF4 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UpBZ0GSB; 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: B3H+Vk6+b+cT --=-=-= Content-Type: text/plain; format=flowed Ihor Radchenko writes: > What we should not have is "make autoloads" failing without > internet. The attached patch should take care of that. If the ls-remote errors, GITVERSION will be set to N/A as when it is generally unavailable. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-mk-targets.mk-GITVERSION-support-shallow-repo-clones.patch Content-Description: revised-to-handle-upstream-unavailable >From 4ce8b2dfc2cf2ca1507aa14be15f5212eb1de229 Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Mon, 16 Jan 2023 14:00:41 -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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mk/targets.mk b/mk/targets.mk index 4435daa9..9a62cbd4 100644 --- a/mk/targets.mk +++ b/mk/targets.mk @@ -14,7 +14,15 @@ 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 + GITVERSION ?= N/A GITSTATUS ?= $(shell git status -uno --porcelain) else -include mk/version.mk -- 2.39.0 --=-=-=--