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 CK3WAMh8yGPxhwAAbAwnHQ (envelope-from ) for ; Thu, 19 Jan 2023 00:12:08 +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 aJ+sAMh8yGNOswAAauVa8A (envelope-from ) for ; Thu, 19 Jan 2023 00:12:08 +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 B685D1BCCA for ; Thu, 19 Jan 2023 00:12:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIHaq-00087v-MR; Wed, 18 Jan 2023 18:11:44 -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 1pIHap-00087S-Cj for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 18:11:43 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIHan-00074d-QU for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 18:11:43 -0500 Received: by mail-qt1-x835.google.com with SMTP id fd15so215394qtb.9 for ; Wed, 18 Jan 2023 15:11:41 -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=vEyAg/6QgIDMKw8r2WZEnC/3l2vV+QfwbP+lFZ6aWMA=; b=qriB/5F19DM4/u4PDynBVC6O8h2fLCWpsmIIqf3YdEuOaOvtCn1AdeFrgwxkKQ6Dhw 6YRKw0cIG0b1pQRqyGAy0+FKPtH8JZuzxM+Kxs8QGbGdqAdMAKtQzIYZX6y/zRC9Pf0Q gmhck2BV0rRI9iBCriQVP8HRYxNadbRcSTNRs1OpDClHEoAkx/OLlP7xRxUU5tyM8u3w kL20YVTWZZ/lgU2galACM1n7qevEIzBM+PebZUOFSSnTlN6AmeZ2DjWCOHaF2M9roLyt 8VX6d3gLeCSrqvfm4I0CQqbPqfTjSsCjbRHRtuefyyniOOWyC+Ecpi4eiJKgGc5/fmx8 WR/w== 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=vEyAg/6QgIDMKw8r2WZEnC/3l2vV+QfwbP+lFZ6aWMA=; b=5mDrDl0FqVTjPPoMmg9DcZPGEl9otmcj8rhu5c0iwipbWFSoZUQCZmm7b64qzrkq4/ E2GZ7Or1Tsbl6JPJkAiaHbrtg9/VvFNr0LAK0gq1PDCkwUDIEDHPMujPsFkpGAOYr7qg dCr5Ix638xt9TD4e0pell6Bhvy+vemVi3rg2mOE9lamV2EHa4ESt8WsDtHljKzzSJMVI jZ3mC9Y9u30Cv8Exb18rTB5fQnrKOMy2d+ofmq66YNOcZaiefk2rAVf2H0gHu3z9TlGx B7qPWegvyAwS7z5dirAOE6CWIKINp15O84vZquL6IZw1j5wUcHleXik722NkFMqLRJpu wlXg== X-Gm-Message-State: AFqh2koCw2K7EODya0d9rQ4R2hUCyqwSZ2Fmc3ow4A6iEnTvRzJbzu/9 FuENWVI4/m+dC468VkThra57bgUJzbM= X-Google-Smtp-Source: AMrXdXtwXT44QDpEmpbXjLIQo9mkprycXBSgEIvyuJE0k0TiI+RFrYX8/CwVbWqq+IYnSeyC7x2IrA== X-Received: by 2002:ac8:47ca:0:b0:3a8:84f:1d3a with SMTP id d10-20020ac847ca000000b003a8084f1d3amr11274158qtr.9.1674083500468; Wed, 18 Jan 2023 15:11:40 -0800 (PST) Received: from nbook ([2601:82:c200:166d:7a0:14e6:e26:75bd]) by smtp.gmail.com with ESMTPSA id b5-20020a05620a04e500b006ee8874f5fasm22517053qkh.53.2023.01.18.15.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 15:11:39 -0800 (PST) References: <87r0vvr2ai.fsf@gmail.com> <87358alhux.fsf@localhost> <87tu0q5m2t.fsf@gmail.com> <877cxligy6.fsf@localhost> <87fsc7e8ub.fsf@gmail.com> User-agent: mu4e 1.9.14; emacs 30.0.50 From: No Wayman To: No Wayman 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: Wed, 18 Jan 2023 18:12:32 -0500 In-reply-to: <87fsc7e8ub.fsf@gmail.com> Message-ID: <87bkmve8qv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qt1-x835.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-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674083527; 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=vEyAg/6QgIDMKw8r2WZEnC/3l2vV+QfwbP+lFZ6aWMA=; b=uHhS9X1AY+Uwoa9Nv8CeZGSf0gBmAQxiUFxQqpGebgMCkyRnqGXqDOOp0eXIArP0c0wi4m J5JvGroEUM3Hy2s7oSCnZ/DEOk3ohtJwKDkteRa+MkRgcpPKxMCS6H+a3UlVqyoptWhbr+ EhS3MPf1rEZuc/xcKLxcuMR3Lh/y/b9J6Aq5TR1c2e86ZCl94j2uZdvbhueR8uqIrzTx/l j+x1yam6HHFirfn0cqfr5xqop0UzQRqzqKFHOQ/rmK1n5eV6qYMVf5krvftWFVTbi6Uafj foUEBwWU9FO6lPrOaGeHVq6ofZF5s7fgxXsHQ1sAwe81QFYuvLT5zH57xGNEfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="qriB/5F1"; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674083527; a=rsa-sha256; cv=none; b=ulI5sgos9e/jW3miP023Y2NMPDzuhtYVt6kF+otlbvx3Yan9gakfA0X60CSaCE8orQNfEs MUsP3LDZHhEGfFP7pE9U7g7FpA0AFDQSo3BdmIEkqUaauOmiGIJ37kaU4Y3Jc0t2ammwvw L4UJnanQNetrh2JMgiO4OzowfmXqazafDhEInRE/ZQYMQOX9T02ZrMDe5pXH7i2H5aEjq2 6LtPwk9Zr88bKMCY5icjWwWQ7oGacxych2x+0D9YnYPzD+876Hx+Aar4IdrqYTrlsQvB7j XWzUnjn6Csg4Lxcee8NB4g09//keW4QPykqryQ1p1yOW/76Jz+YTib4+jwo/3Q== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.78 X-Spam-Score: -4.78 X-Migadu-Queue-Id: B685D1BCCA Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="qriB/5F1"; dmarc=pass (policy=none) header.from=gmail.com; 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" X-TUID: 5mm8Qbp9efhe --=-=-= Content-Type: text/plain; format=flowed No Wayman writes: > The attached patch should take care of that. Sorry. Had trailing whitespace in that version. Attached here without trailing whitespace. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-mk-targets.mk-GITVERSION-support-shallow-repo-clones.patch Content-Description: without trailing space >From 85990610ca7572f5a6ff7604d957efdf00747094 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 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mk/targets.mk b/mk/targets.mk index 4435daa9..be79a127 100644 --- a/mk/targets.mk +++ b/mk/targets.mk @@ -14,7 +14,20 @@ 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) + TAG := $(lastword $(REMOTETAGS)) + ifneq ($(TAG),) + TAGPREFIX := $(subst refs/tags/,,$(TAG)) + GITVERSION ?= $(subst ^{},-n/a-g$(COMMIT), $(TAGPREFIX)) + else + GITVERSION ?= $(ORGVERSION)-n/a-g$(COMMIT) + endif + 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 --=-=-=--