emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,  emacs-orgmode@gnu.org
Subject: Re: org-assert-version considered harmful
Date: Sun, 25 Sep 2022 19:10:40 +0800	[thread overview]
Message-ID: <87v8pbr9ov.fsf@localhost> (raw)
In-Reply-To: <8735cfn44v.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]

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])


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-mk-targets.mk-ORGVERSION-Prefer-lisp-org.el-version-.patch --]
[-- Type: text/x-patch, Size: 1811 bytes --]

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 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


[-- Attachment #3: Type: text/plain, Size: 206 bytes --]


-- 
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	other threads:[~2022-09-25 11:20 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 18:27 org-assert-version considered harmful Stefan Monnier
2022-09-13  1:52 ` Ihor Radchenko
2022-09-13  2:16   ` Timothy
2022-09-13  2:53   ` Stefan Monnier
2022-09-13  3:18     ` Ihor Radchenko
2022-09-13 13:26       ` Stefan Monnier
2022-09-13 14:42         ` Ihor Radchenko
2022-09-13 16:13           ` Stefan Monnier
2022-09-14  2:46             ` Ihor Radchenko
2022-09-14 14:08               ` Stefan Monnier
2022-09-14 19:13                 ` Tim Cross
2022-09-25  2:39               ` Bastien
2022-09-25  3:15                 ` Ihor Radchenko
2022-09-25  4:27                   ` Timothy
2022-09-25  9:37                   ` Bastien
2022-09-25  9:55                     ` Ihor Radchenko
2022-09-25 10:24                       ` Bastien
2022-09-25 11:10                         ` Ihor Radchenko [this message]
2022-09-25 11:26                           ` Bastien
2022-09-25 12:16                             ` Ihor Radchenko
2022-09-25 13:18                               ` Bastien
2022-09-26 11:15                                 ` Ihor Radchenko
2022-09-25 12:20                             ` Ihor Radchenko
2022-09-25 13:16                               ` Bastien
2022-09-26 11:29                 ` Ihor Radchenko
2022-09-27 21:35                   ` Bastien
2022-10-31 14:11                     ` Cook, Malcolm
2022-10-31 20:16                       ` [External] : " Daniel Ortmann
2022-10-31 20:40                         ` Cook, Malcolm
2022-10-31 23:16                       ` Tim Cross
2022-11-01  6:09                       ` Ihor Radchenko
2022-11-02 20:42                         ` Cook, Malcolm
2022-11-03  7:51                           ` Ihor Radchenko
2022-11-03 17:30                             ` Cook, Malcolm
2022-12-02  8:16                               ` Tom Gillespie
2022-12-02  6:45                                 ` Ihor Radchenko
2022-12-04  4:22                                   ` Tom Gillespie
2022-12-04  4:33                                     ` Stefan Monnier
2022-12-04 11:12                                       ` Ihor Radchenko
2023-08-16 11:08                                         ` Ihor Radchenko
2023-08-16 12:30                                           ` Stefan Monnier
2023-08-16 12:41                                             ` Ihor Radchenko
2023-08-16 13:41                                               ` Stefan Monnier
2023-08-18  9:37                                                 ` Ihor Radchenko
2023-08-18 13:19                                                   ` Stefan Monnier
2023-08-18 13:33                                                     ` Ihor Radchenko
2023-08-18 13:45                                                       ` Stefan Monnier
2023-08-18 14:26                                                         ` Ihor Radchenko
2023-08-18 14:29                                                           ` Ihor Radchenko
2023-08-17 16:43                                           ` Max Nikulin
2023-08-17 16:59                                             ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8pbr9ov.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).