diff mbox

[bug#53909,0/4] 'guix pull -l' no longer displays package lists by default

Message ID 87mtiy8wnm.fsf_-_@gmail.com
State Accepted
Headers show

Commit Message

Simon Tournier Feb. 10, 2022, 5:21 p.m. UTC
Hi Ludo,

Cool!  Thanks.


On Wed, 09 Feb 2022 at 23:17, Ludovic Courtès <ludo@gnu.org> wrote:

> * guix/scripts/pull.scm (show-help, %options): Add "--details".

IMHO, the commit online header should reflect that.


> diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm

[...]

>  (define (process-query opts profile)
>    "Process any query on PROFILE specified by OPTS."
> +  (define details?
> +    (assoc-ref opts 'details?))
> +
>    (match (assoc-ref opts 'query)
>      (('list-generations pattern)
>       (define (list-generations profile numbers)
>         (match numbers
>           ((first rest ...)
>            (display-profile-content profile first)
> +
>            (let loop ((numbers numbers))
>              (match numbers
>                ((first second rest ...)
> -               (display-profile-content-diff profile
> -                                             first second)
> +               (if details?
> +                   (display-profile-content-diff profile
> +                                                 first second)
> +                   (display-profile-content profile second))
>                 (display-channel-news (generation-file-name profile second)
>                                       (generation-file-name profile first))
>                 (loop (cons second rest)))

Well, "guix pull --details" pulls; which I find annoying.  Instead, I
propose to silently runs "guix pull --details -l", see this diff:
Because warn people that "guix pull --details" alone is not what they
want adds some complexity, and when '--details' only works in tandem
with the option '--list-generations', that’s why I propose this
behaviour.


Last, about this change…

> -  (define (no-arguments arg _‌)
> +  (define (no-arguments arg _)

…it a Git twist?  I miss what changed––my whitespace mode is badly
configured?



Cheers,
simon

Comments

Ludovic Courtès Feb. 14, 2022, 2:56 p.m. UTC | #1
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> On Wed, 09 Feb 2022 at 23:17, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> * guix/scripts/pull.scm (show-help, %options): Add "--details".
>
> IMHO, the commit online header should reflect that.

Right, fixed.

> Well, "guix pull --details" pulls; which I find annoying.  Instead, I
> propose to silently runs "guix pull --details -l", see this diff:
>
> diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
> index 707f1f0929..fb1dd6c82c 100644
> --- a/guix/scripts/pull.scm
> +++ b/guix/scripts/pull.scm
> @@ -142,7 +142,9 @@ (define %options
>                           result)))
>           (option '("details") #f #f
>                   (lambda (opt name arg result)
> -                   (alist-cons 'details? #t result)))
> +                   (alist-cons 'details? #t
> +                               (cons '(query list-generations #f)
> +                                     result))))

It’s a bit more complicated since you don’t want to override previous
‘-l’ arguments, but I did that.

> Last, about this change…
>
>> -  (define (no-arguments arg _‌)
>> +  (define (no-arguments arg _)
>
> …it a Git twist?  I miss what changed––my whitespace mode is badly
> configured?

There’s a ZERO WIDTH NON-JOINER above; you can see it with a trick I
recently learned: (set-face-background 'glyphless-char "red").

:-)

Anyway, pushed:

  054ec2e242 pull: '--list-generations' pipes its output to the pager.
  5b6e31b020 ui: 'display-generation' uses color when talking to a pager.
  7ffcee1937 ui: 'with-paginated-output-port' gives access to the wrapped port.
  b9df2e2b4d pull: '--list-generations' lists packages only with '--details'.

Thanks!

Ludo’.
Simon Tournier Feb. 14, 2022, 5:28 p.m. UTC | #2
Hi Ludo,

On Mon, 14 Feb 2022 at 15:56, Ludovic Courtès <ludo@gnu.org> wrote:

> >           (option '("details") #f #f
> >                   (lambda (opt name arg result)
> > -                   (alist-cons 'details? #t result)))
> > +                   (alist-cons 'details? #t
> > +                               (cons '(query list-generations #f)
> > +                                     result))))
>
> It’s a bit more complicated since you don’t want to override previous
> ‘-l’ arguments, but I did that.

Ah yes, indeed.  Keep the pattern. :-)

> There’s a ZERO WIDTH NON-JOINER above; you can see it with a trick I
> recently learned: (set-face-background 'glyphless-char "red").

Oh, cool.  Thanks!


> Anyway, pushed:

Thanks for the quick fix and I hope more people will read now the news. :-)

Cheers,
simon
diff mbox

Patch

diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 707f1f0929..fb1dd6c82c 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -142,7 +142,9 @@  (define %options
                          result)))
          (option '("details") #f #f
                  (lambda (opt name arg result)
-                   (alist-cons 'details? #t result)))
+                   (alist-cons 'details? #t
+                               (cons '(query list-generations #f)
+                                     result))))
          (option '("roll-back") #f #f
                  (lambda (opt name arg result)
                    (cons '(generation roll-back)