emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-assert-version considered harmful


From: Ihor Radchenko
Subject: Re: org-assert-version considered harmful
Date: Sun, 25 Sep 2022 19:10:40 +0800

Bastien <bzg@gnu.org> writes:

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> org-git-version is very useful when people report bugs.
>> M-x org-submit-bug-report supplies org-git-version output for bug
>> subject. Thus, we can easily check which git commit their build
>> corresponds to.
>
> Let's keep `org-git-version'.  If we manage to release Org more often
> (minor and major versions), I doubt keep `org-git-version' will remain
> that useful in practise, though.  Let's revisit the topic then.

I think that it will still be useful. In particular, consider major new
feature development. We may take a longer delay between releases then.

>> Note that we already have a way to parse Org version from lisp/org.el,
>> similar to what the commit you referenced does.
>> It is just that this code path is not used by default.
>
> I'd favor using it by default.
>
> When using Org from the main branch of the git repository,
> M-x org-version RET should return this:
>
> "Org mode version 9.6-dev (release_9.5.5-822-g0a6a56 @ [load-path])"

The code I quoted explicitly removes the "-dev" part. Would you prefer
to keep it?

> Can you provide a patch for the above suggestions?  I'll test and see
> if more fixes are needed, even though I'm also not that familiar with
> the code either.

See the attached.
After the patch, org-version returns
Org mode version 9.6 (release_9.5.5-830-g77f9e1 @ [load-path])

>From 77f9e16d7436ca629384e6574f2231e275ea8447 Mon Sep 17 00:00:00 2001
Message-Id: 
<77f9e16d7436ca629384e6574f2231e275ea8447.1664104208.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Sun, 25 Sep 2022 19:02:17 +0800
Subject: [PATCH] * mk/targets.mk (ORGVERSION): Prefer lisp/org.el version
 header

Do not use the latest Git tag.  Prefer the Version header in org.el.

The Git tag on main branch is only available for the latest release.
Before this commit, development Org version was indistinguishable from
the release version.

See 8735cfn44v.fsf@gnu.org">https://orgmode.org/list/8735cfn44v.fsf@gnu.org
---
 mk/targets.mk | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/mk/targets.mk b/mk/targets.mk
index 5cba63e21..518635737 100644
--- a/mk/targets.mk
+++ b/mk/targets.mk
@@ -11,16 +11,10 @@ INSTSUB       = $(SUBDIRS:%=install-%)
 ORG_MAKE_DOC ?= info html pdf
 
 ifneq ($(wildcard .git),)
-  ORGVERSION ?= $(subst release_,,$(shell git describe --match release\* 
--abbrev=0 HEAD))
-  ifeq ($(ORGVERSION),)
-    # In elpa.git, there are no tags available.  Fall back to using
-    # the org.el header.
-    ORGVERSION := $(patsubst %-dev,%,$(shell $(BATCH) --eval "(require 
'lisp-mnt)" \
-      --visit lisp/org.el --eval '(princ (lm-header "version"))'))
-    GITVERSION ?= $(ORGVERSION)-g$(shell git rev-parse --short=6 HEAD)
-  else
-    GITVERSION ?= $(shell git describe --match release\* --abbrev=6 HEAD)
-  endif
+  # 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)
   GITSTATUS  ?= $(shell git status -uno --porcelain)
 else
  -include mk/version.mk
-- 
2.35.1

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92

reply via email to

[Prev in Thread] Current Thread [Next in Thread]