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 6B4JHV5cxGPKfgAAbAwnHQ (envelope-from ) for ; Sun, 15 Jan 2023 21:04:46 +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 IMP6HF5cxGOwCAEAauVa8A (envelope-from ) for ; Sun, 15 Jan 2023 21:04:46 +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 3053DA45D for ; Sun, 15 Jan 2023 21:04:46 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pH9EH-0000qN-UY; Sun, 15 Jan 2023 15:03:45 -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 1pH9EG-0000qE-IC for emacs-orgmode@gnu.org; Sun, 15 Jan 2023 15:03:44 -0500 Received: from mail-vs1-xe30.google.com ([2607:f8b0:4864:20::e30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pH9EE-0002qo-CH for emacs-orgmode@gnu.org; Sun, 15 Jan 2023 15:03:44 -0500 Received: by mail-vs1-xe30.google.com with SMTP id k4so27203977vsc.4 for ; Sun, 15 Jan 2023 12:03:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=0DOVEhrbYxA4hIMxEqtmppSfPIZESTCD/v+Gtf8sx0w=; b=WTTo4pM70QA03+sKzV8pHxaoymfytp7qXSK2G+ZAzQUFQIwNiJ7+pPyvamgQBOtFyw YbcWqPAIt0lIw+sMZPWrh6wnvCXfuBF+gTNEWFVCUALKs+RMi8zwsqiugQodJaw7jwyy Q0xb4W1+UUxPnCJsQxBe66d6Ut6U4VXBN1zldpqdGlEUpK769haJSy8V3l7ZauJvXPo5 BHULFWugsW+PnHdEen+02S5uKJoQa/8hwMC4VGNustGjbuEQqVy+7wKIRryEYMYzGYEi Mnde0zZE1XTPblBTyTRZP+2Q/U0er0G2H9T7Qr15S9qc+h94IoO32VeVyVwEp6316X6z 2nag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0DOVEhrbYxA4hIMxEqtmppSfPIZESTCD/v+Gtf8sx0w=; b=q2HRAVy8j5Gxvf9zAML4n6h80XmncUC0pz0G/dIavf17eLpNRh31+VQ+x+mmGP843f ITQjFqDeY2Xx/pFAtq/phTG/xfEgwg9aDwDkX0z4QTg0H8XuhW+8UAc+wGlFxDNPA6wD ZE7Alx8mqoUrpkpzpX054eGEbZexhDV1hZjZ4Lv4sOMohFd7Sv6F/qlB4x5Q0+0VvNm5 lCMHG4/uh2tUHyTFBoDWjxVCKcev3AXjBNTz5Uokqycssx6BqXs57LgMvUOaStzPgKWc KZC5nJWEXbtXKKgO70LdHULj6OpgPc+kfdeQmdWa+M6OF+QUgnz8K9aeeeNIdfZyVh0j Q1pw== X-Gm-Message-State: AFqh2koq9pX8OGo8PGonJAdYluepOiA8evqYbgO0OnHTRGKzsrqlKOV4 wEjrOfezEAwuinNdi9JarRHhiDHXiBA= X-Google-Smtp-Source: AMrXdXu3oRBQyw3ElFhXeqsKqH0FV8lRBoMaJx/ujihIDvf/N5HPAZWui32An20dSPOU34B8IIa7Jw== X-Received: by 2002:a05:6102:d8a:b0:3d3:c4f7:da2b with SMTP id d10-20020a0561020d8a00b003d3c4f7da2bmr2314912vst.19.1673813014120; Sun, 15 Jan 2023 12:03:34 -0800 (PST) Received: from nbook ([2601:82:c200:166d:7a0:14e6:e26:75bd]) by smtp.gmail.com with ESMTPSA id bm16-20020a05620a199000b006e16dcf99c8sm16879266qkb.71.2023.01.15.12.03.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 12:03:33 -0800 (PST) User-agent: mu4e 1.9.12; emacs 30.0.50 From: No Wayman To: emacs-orgmode@gnu.org Subject: [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:01:51 -0500 Message-ID: <87r0vvr2ai.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::e30; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-vs1-xe30.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-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=WTTo4pM7; 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-Seal: i=1; s=key1; d=yhetil.org; t=1673813086; a=rsa-sha256; cv=none; b=qfzOQMzOqF2TD++G7ZT8NifaWjlQYl/8caVPsi1+sP3dq/uXTtAfcOYyWBT4ILuC+ZwGZT lG4tSz33RuOCbH30JK7IxLl8QvYUsN/u66R2PFsioBKfKwXIFcYH6MSFJnpBobWNSaZWaV U3CMFrZ4qHForq3yKPyWCuBF4KjK6Q823W2nzf9I1peGeP6yHlqz28cy+qSZhzIbfNKKaU 6YYXJWqTjOdxO/S41ZNiHqFI11eg2sD0BcwLSOHC0XKqd5wsP7817AITHaiIDh7RJS+O/s HPOcT38HsgqE7XvIaswWqYaFjwqfGd7RmwZtdwQZ7s9XuDqbgxkoA2YzxBiU4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673813086; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0DOVEhrbYxA4hIMxEqtmppSfPIZESTCD/v+Gtf8sx0w=; b=bUnaFNPgBTgETS/Wa1rY5XxCbSZ8eQQBLBiVRBpclK3gZAk0KADyE9m/m6mV4mi36dPy8b grg2uW+htEy3fnwNHRhBU9tWUHGbGMhl1LalR15cfC81zkLItnUEl4jzZnjn9Moofgip7V xOFjSiB51lfbrBjxn80Of0mIM6UJc9gsIc4fOZVB9j0xN9uQQ+fflD5A9y4NnxaYecrxr0 UNf4gD0W1TSa0kMN7XJ0k6lITtizUiORSaNme9a6Zlxl4s0oux4MBoIbXgfbafyGSZ2unD RadMZshS8JqyUSkPbHPsiKuhZVt5VM0D80dwNjvqVOp8T741cqfKi1k3EpJgyA== X-Migadu-Queue-Id: 3053DA45D X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=WTTo4pM7; 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-Migadu-Spam-Score: -7.57 X-Spam-Score: -7.57 X-TUID: BjZnw86J9Jxw --=-=-= Content-Type: text/plain; format=flowed In order to properly generate org-version.el, the current build in mk/targets.mk requires a query of the repo's tags. Shallow clones do not have tags and so org-version will be generated as "N/A". In the attached patch, support for generating org-version.el from shallow clones is added. It is done by querying the upstream remote via git ls-remote and parsing the output. In this case, a more well formed org-version string will be generated. However, it will be missing the "commits since last tag" information. e.g. "release_9.6.1-n/a-gabc123" --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-mk-targets.mk-GITVERSION-support-shallow-repo-clones.patch >From 28c596320f48e4606f8eaf69fdc1c83fb084749e Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Sun, 15 Jan 2023 14:55:11 -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 4435daa91..300fc8e0b 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 echo $(firstword $(REMOTETAGS)) | cut -c 1-6) + 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 --=-=-= Content-Type: text/plain; format=flowed Emacs : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6) of 2023-01-08 Package: Org mode version 9.6.1 (release_9.6.1-137-gecb62e @ /home/n/.emacs.d/elpaca/builds/org/) --=-=-=--