unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Dunn <dunn.alex@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 22046@debbugs.gnu.org
Subject: bug#22046: [PATCH] Improve version-to-list parsing
Date: Mon, 30 Nov 2015 18:09:03 -0800	[thread overview]
Message-ID: <m27fky539c.fsf@snow.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <83r3j7mqpr.fsf@gnu.org>


The recipes MELPA uses for building packages are usually just the name,
the repository, and the method of fetching it (git, svn, etc).  To
figure out if there’s a stable version of the package, MELPA parses the
repository’s tags; if the tags aren’t valid version-strings (according
to version-to-list) it assumes there isn’t a stable version available
and packages it as “HEAD-only”.

So MELPA is at the mercy of upstream developers’ tagging practices, and
sometimes they do things like “OTP-18.0.5”: https://github.com/erlang/otp/tags

Another solution to this particular problem is for MELPA to allow their
recipes to specify a custom version schema; but my thought was that
making version-to-list more flexible was a good thing.  Parsing git tags
seems like a common enough use-case that it might be nice to have this.

But it’s true that with this change some very long strings will be
parsed as valid.  This returns '(0 9), which is sort of ridiculous:

(version-to-list "It’s true that with this change some very long strings will be parsed as valid: 0.9")

But I guess I’m not sure what the danger is in letting that happen.  Is
version-to-list often used to parse arbitrary strings, where false
positives would cause problems?

Thanks,
Alex

Eli Zaretskii <eliz@gnu.org> writes:

> But I've just realized that this is a followup to a previous patch, so
> let me step back and respond to that.
>
>> This was prompted by an issue over at MELPA, where they were having
>> trouble packaging stable versions of erlang-mode due to Erlang’s odd
>> version-strings: https://github.com/milkypostman/melpa/issues/2553.  So
>> with this patch, 'OTP-18.0.5' is valid and parsed as '(18 0 5).
>
> Sorry, I don't understand the issue; can you clarify?  "OTP-18.0.5" is
> not a valid version string, you are supposed to submit just the
> "18.0.5" part to the Emacs version-handling facilities.  Why isn't
> that being done here, or why cannot it be done?  Especially since the
> changes you propose effectively ignore the "OTP-" part anyway, as they
> indeed should: AFAIU, "OTP" has nothing to do with versioning.
>
> Treating "SOMETHING-1.2.3" as a valid version string changes the rules
> significantly, and IMO opens a Pandora box, as we suddenly need to be
> able to recognize/allow words that have nothing to do with versioning,
> as opposed to a few words (alpha, beta, CVS, etc.) that do.  I don't
> think we should go that way without a very good reason and some
> important use cases.
>
>> - The docstring said “22.8X3” was invalid, when it actually was; it got
>>    parsed as '(22 8 24 3).  I’ve made it really invalid.
>
> This change in behavior is definitely worth making, thanks.





  reply	other threads:[~2015-12-01  2:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-28 22:26 bug#22046: [PATCH] Improve version-to-list parsing Alex Dunn
2015-11-30  0:09 ` Alex Dunn
2015-11-30  3:34   ` Eli Zaretskii
2015-11-30  3:54     ` Alex Dunn
2015-11-30  7:59       ` Andreas Schwab
2015-11-30 15:50       ` Eli Zaretskii
2015-12-01  2:09         ` Alex Dunn [this message]
2015-12-01  3:38           ` Eli Zaretskii
2015-12-02  4:14             ` Alex Dunn
2015-12-05  9:36               ` Eli Zaretskii

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m27fky539c.fsf@snow.i-did-not-set--mail-host-address--so-tickle-me \
    --to=dunn.alex@gmail.com \
    --cc=22046@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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.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).