From: Mark H Weaver <mhw@netris.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Version strings for VCS snapshots
Date: Wed, 23 Sep 2015 19:35:41 -0400 [thread overview]
Message-ID: <87si64u2sy.fsf@netris.org> (raw)
In-Reply-To: <87twqpkq8r.fsf_-_@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\?\= \=\?utf-8\?Q\?\=22's\?\= message of "Sun, 20 Sep 2015 18:30:28 +0200")
ludo@gnu.org (Ludovic Courtès) writes:
> Eric Bavier <ericbavier@openmailbox.org> skribis:
>
>> I realize we have no guidelines in the manual concerning the version
>> field for git checkouts, but I wonder whether we should, as it comes up
>> a bit. Several existing packages use (string-append "1.2.3." commit),
>> where "1.2.3" is the version of the corresponding source. One other
>> package uses the (string-append "1.2.3-c" commit) method, and another
>> uses (string-append "1.2.3-" commit. I personally prefer the "-"
>> notation, since it distinguishes the commit hash from the version
>> number (does it confuse any internal logic that assumes a package
>> version number is the last component of the store path following a
>> dash?). In this case, the "-c" seems confusing because the commit hash
>> itself begins with a 'c'.
>>
>> I recall some discussion previously about how it would be nice for
>> git-checkout package versions to still "sort" nicely.
>
> I think the goal should be to ensure lexicographic ordering, such that
> ‘guix package --upgrade’ DTRT.
>
> In practice, that means the (string-append "1.2.3." commit) should be
> avoided.
>
> Instead we should use (string-append "1.2.3." REV "." commit) where REV
> would be an integer we manually increment every time we upgrade to a
> newer snapshot.
I'd like to propose another alternative, which I used for 'grub' on the
'wip-loongson2f' branch. There, the version string is simply the output
of "git describe". This gives us lexicographic ordering, and the commit
id can be extracted with (last (string-split version #\g)).
So, it ends up looking like this:
--8<---------------cut here---------------start------------->8---
(define-public grub
(package
(name "grub")
(version "2.02-beta2-502-gc93d3e6")
(source (origin
(method git-fetch)
(uri (git-reference
(url "git://git.savannah.gnu.org/grub.git")
(commit (last (string-split version #\g)))))
(file-name (string-append name "-" version "-checkout"))
(sha256
(base32
"14xsqx3b8rqr0i2xn5vrf8mnxlajw8msi1r6h2vgpl2j0zgjc1m0"))))
--8<---------------cut here---------------end--------------->8---
What do you think?
Mark
next prev parent reply other threads:[~2015-09-23 23:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 19:25 [PATCH] Add MARS shooter Ricardo Wurmus
2015-09-19 8:25 ` Ricardo Wurmus
2015-09-19 15:44 ` Thompson, David
2015-09-19 20:06 ` Ricardo Wurmus
2015-09-19 20:33 ` Thompson, David
2015-09-20 7:51 ` Ricardo Wurmus
2015-09-20 9:46 ` Ricardo Wurmus
2015-09-25 22:30 ` Christopher Allan Webber
2015-09-26 13:04 ` Ludovic Courtès
2015-09-19 17:17 ` Eric Bavier
2015-09-20 10:08 ` Ricardo Wurmus
2015-09-20 16:30 ` Version strings for VCS snapshots Ludovic Courtès
2015-09-23 6:13 ` Ricardo Wurmus
2015-09-23 23:35 ` Mark H Weaver [this message]
2015-09-24 8:11 ` Andreas Enge
2015-09-24 11:12 ` Ludovic Courtès
2015-09-20 15:49 ` [PATCH] Add MARS shooter Ricardo Wurmus
2015-09-20 20:19 ` Eric Bavier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87si64u2sy.fsf@netris.org \
--to=mhw@netris.org \
--cc=guix-devel@gnu.org \
--cc=ludo@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.