guix-devel
[Top][All Lists]
Advanced

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

Re: nicer “guix describe” commit display


From: Ludovic Courtès
Subject: Re: nicer “guix describe” commit display
Date: Sun, 08 Mar 2020 23:27:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi!

Ricardo Wurmus <address@hidden> skribis:

> in the past we discussed printing more readable commits with “guix
> describe”.  This patch would do that:
>
> diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
> index f13f221da9..c5fcef1bcd 100644
> --- a/guix/scripts/describe.scm
> +++ b/guix/scripts/describe.scm
> @@ -26,6 +26,7 @@
>    #:use-module (guix describe)
>    #:use-module (guix profiles)
>    #:use-module (git)
> +  #:use-module (git describe)
>    #:use-module (json)
>    #:use-module (srfi srfi-1)
>    #:use-module (srfi srfi-37)
> @@ -127,7 +128,8 @@ string is ~a.~%")
>                           (exit 1))))
>           (repository (repository-open directory))
>           (head       (repository-head repository))
> -         (commit     (oid->string (reference-target head))))
> +         (commit-ref (commit-lookup repository (reference-target head)))
> +         (commit     (describe-format (describe-commit commit-ref))))
>      (match fmt
>        ('human
>         (format #t (G_ "Git checkout:~%"))
>
> It does, however, depend on the most recent released version of
> guile-git, which introduced (git describe).  It would fail with any
> previous version.
>
> It is also not clear if the output would actually be better for use in
> channel files.

I think it’s fine to use this feature.  However, I’d use it only for the
'human format, and perhaps also in addition to the actual commit ID,
which is always useful.

Actually, would it be nicer to display the git-describe string as part
of the ‘guix --version’?

Ludo’.



reply via email to

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