From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +LcZLEx8yGMgTwEAbAwnHQ (envelope-from ) for ; Thu, 19 Jan 2023 00:10:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WKrvK0x8yGNuFgAAauVa8A (envelope-from ) for ; Thu, 19 Jan 2023 00:10:04 +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 7F7293FB4C for ; Thu, 19 Jan 2023 00:10:04 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIHYn-0007GF-I5; Wed, 18 Jan 2023 18:09:37 -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 1pIHYl-0007Fv-H3 for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 18:09:35 -0500 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIHYj-0006Ue-G6 for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 18:09:34 -0500 Received: by mail-qt1-x836.google.com with SMTP id o5so202242qtr.11 for ; Wed, 18 Jan 2023 15:09:32 -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=Nzw+6ZLWqwByaIZWjqwzr6fxqpu44o9mk98AnoQpsLc=; b=loHrrd3M/oSVyTSHdO/PYhu9L1pdR+BHlNDfe+ELsUreLU66k9DhrYPcI91WYnto46 dDP8ZDw0rjwPhuqwJg/6LmMHGOzjVdffEe1KJExBF/yTBEFpsDtt0vPtgANsnT+Jxpr9 JgLUckij0icsShCh+f2JBGfl68HIlqzOO6r3q+bxT0BJLoWx5vj+f/xc68KMIpyGGMaS U4y1EfCvgmaXekvtzZfiZebd6P3tbEOXv6W56uDJIL/2mwAEbAVVYJOca1ZabXjIenbF 6966WyZBklZ1ru1Qg03GIZRtoa/wEDNz6UwHImHetxmC+lrwCbJ1tBUcY+/hAGwxtkUI +1Rw== 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=Nzw+6ZLWqwByaIZWjqwzr6fxqpu44o9mk98AnoQpsLc=; b=53LE8rm/uFsTdJ+2lRvcT8dc5rxasfKiW/unOEMPZxns/cSjPGB/EKRi+VsF684iIw 3iQAz0uNCmKs9ptqAMi+0f1Q3f8BaoSdeujEFlP1O7uW1UATBxMmt2fRfVliwYXSJ1Mk 23Y8UV/tlTdIXomXXHtIPgWjH10sIybuYsD3xYzgV3H6JtdufaCj6KVhbHf451Cz6pZe 908l85EP6i0TEqVpq+VLSHL4Ps8JIiMnaLyGmYL4T95vH6jir7Yk2d/Xe9NtC/XLZ+SB g7R2C9p3xioteXtAsUNF+CjXkLzLXt78Xu808Nt5rmFKmFuZx1DCbM3vX7JoT7FvoXET gG+A== X-Gm-Message-State: AFqh2koMDkcYyGnp53GjwLvTB2MJhyaKSBQavVFGXy3u4oE5oy7md/Jz d+RbsfoZsUOrMpRaKv+kWRsKi/lff5s= X-Google-Smtp-Source: AMrXdXuzrUrxxWrjHk2KgVI8KHQdIYDWxyfPB+WkWPBh4HbfcoerzTstRHQSKgB3JTvi4WAK/oH69A== X-Received: by 2002:ac8:75cd:0:b0:3a6:a7a2:57b with SMTP id z13-20020ac875cd000000b003a6a7a2057bmr12711303qtq.6.1674083371664; Wed, 18 Jan 2023 15:09:31 -0800 (PST) Received: from nbook ([2601:82:c200:166d:7a0:14e6:e26:75bd]) by smtp.gmail.com with ESMTPSA id hj4-20020a05622a620400b003995f6513b9sm17844525qtb.95.2023.01.18.15.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 15:09:31 -0800 (PST) References: <87r0vvr2ai.fsf@gmail.com> <87358alhux.fsf@localhost> <87tu0q5m2t.fsf@gmail.com> <877cxligy6.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: Wed, 18 Jan 2023 18:11:09 -0500 In-reply-to: <877cxligy6.fsf@localhost> Message-ID: <87fsc7e8ub.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qt1-x836.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=1674083404; 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=Nzw+6ZLWqwByaIZWjqwzr6fxqpu44o9mk98AnoQpsLc=; b=YOQVq7jG3R+P1LywwoSkE9pLr1n9ToyEFJLg0MmO3JzydqbilL0v3O/YQjGnFbrLZYMAPc Haz3RIZ918gsltBtHMH8pD8LQN7xOz7uDoLNei6hMs+6oLyTzmXjViV9T3Z6d4Z9cc4lMg 2EGIEmP4O9Xu1zcvfURGwi4mHo8LLZYbD8RkM6ZR+1j10VdZlJXp44M3yBuflWeoAZSjNo fbGAkZ7OTkXu57HDjcwISgCo5sGzNaMbXUyNJ5AI18wTK8UY31XyD1PyOfjEbytMAi9FwU /UvGuAIUS3ajLsb/pjg2UXrE/3HpLOCFlxJ9ylWM5+SxeI9QzsU0GzrMaHIG1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=loHrrd3M; 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=1674083404; a=rsa-sha256; cv=none; b=qfdEQmba6OTiPnUJ77MgWkmiI/8Xzn7splhLqpNyz9TqWnvoTF6ui75gZRGcCElj3ftwzA jqvRHXn7RGGsEDf1eDywDusJThcYMLdzcuvOLIr60D2O/IfmIpXWmgqbqhM5Oxn27l5V/W 5pgWAhvPdbFib1v/m+FZr9KBVCiAjCh1EqaPorPQAu3S62SdaijJtRGXHa7KVDLu54diw2 M1Cbnf0gqR3UPAvU781NyBgcsmGiP2bVUo00TTx1j+F2OjKeT0D2U5iV6yc4NTxrSHataK JA85JoiL5N9Pdi9hFJVqzQqHym1SkCJRofCYHNCffotv7Gn+rts6SCnvWFs9Hg== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.78 X-Spam-Score: -4.78 X-Migadu-Queue-Id: 7F7293FB4C Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=loHrrd3M; 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: aYKTsVqL22mX --=-=-= Content-Type: text/plain; format=flowed Ihor Radchenko writes: > No Wayman writes: > >> 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. > > I just tried your patch running make without internet. I got the > following Org version: > > Subject: [BUG] test [9.6.1 ( @ /tmp/org-mode/lisp/)] > > As you can see, the last commit number is not listed even though > I can > see it via git log. The attached patch should take care of that. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-mk-targets.mk-GITVERSION-support-shallow-repo-clones.patch Content-Description: add commit when offline >From 872ba4bf04313692758bcb3d8622c16bbd407101 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..ca6d8c42 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 --=-=-=--