Subject: [bug#72928] [PATCH] time-machine: Print profile path if no command is given.

From: Tomas Volf <[email-masked]>
Date: Sun, 15 Sep 2024 22:38:07 +0200

Hello,

Ludovic Courtès <[email-masked]> writes:

> Hi,
>
> Tomas Volf <[email-masked]> skribis:
>
>> Instead of warning, print the profile path of the cached-channel-instance.
>>
>> * guix/scripts/time-machine.scm (guix-time-machine)[not command-line]: Print
>> the profile directory.
>>
>> Change-Id: Id2c1ded514e6c5af45af9008ad1ef91beb509177
>
> [...]
>
>> +         (if command-line
>> +             (apply execl (cons* executable executable command-line))
>> +             (format #t "~a\n" directory)))))))
>
> Maybe print ‘executable’ rather than ‘directory’?

Printing directory gives nice symmetry between

--8<---------------cut here---------------start------------->8---
$ $(guix build guix)/bin/guix describe
  guix 9a2ddcc
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a
--8<---------------cut here---------------end--------------->8---

and

--8<---------------cut here---------------start------------->8---
$ $(guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a)/bin/guix describe
  guix 9a2ddcc
    repository URL: https://git.savannah.gnu.org/git/guix.git
    commit: 9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a
--8<---------------cut here---------------end--------------->8---

And in some cases you need the store item (guix copy?), and in my
opinion it is easier to go from directory to binary than other way
around.

But just let me know which way I should do it.

>
> Also perhaps add a sentence or two in the manual?

Ah, yeah, definitely.  Once previous point is clarified, I will send v2.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.