channels: Interpret the 'commit' field of channel as a tag or commit.

Previously the 'commit' field would always be interpreted as a commit
ID.  This change adds flexibility, allowing for things like:

  guix time-machine --commit=v1.2.0 -- describe

* guix/channels.scm (channel-reference): Use 'tag-or-commit' rather than 'commit'.
* guix/inferior.scm (channel-full-commit): Likewise.
* doc/guix.texi (Invoking guix pull): Document it.
(Invoking guix time-machine): Likewise.
This commit is contained in:
Ludovic Courtès 2022-10-11 11:19:54 +02:00
parent 46f7011591
commit f36522416e
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 23 additions and 4 deletions

View file

@ -248,7 +248,7 @@ could be found at DIRECTORY or one of its ancestors."
'latest-repository-commit'."
(match (channel-commit channel)
(#f `(branch . ,(channel-branch channel)))
(commit `(commit . ,(channel-commit channel)))))
(commit `(tag-or-commit . ,(channel-commit channel)))))
(define sexp->channel-introduction
(match-lambda