unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default
@ 2022-02-09 22:12 Ludovic Courtès
  2022-02-09 22:17 ` [bug#53909] [PATCH 1/4] pull: '--list-generations' doesn't list package changes " Ludovic Courtès
  2022-02-10 17:51 ` zimoun
  0 siblings, 2 replies; 10+ messages in thread
From: Ludovic Courtès @ 2022-02-09 22:12 UTC (permalink / raw)
  To: 53909; +Cc: Ludovic Courtès, zimoun

Hi!

The other day on IRC zimoun noted that ‘guix pull -l’ doesn’t work for
them because it prints those long package lists, which incidentally
makes it slower.

This series changes ‘guix pull -l’ so that by default it only prints
channel info and news:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix pull -l
Generation 192       Oct 25 2021 00:12:47
  guix b5f45a2
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: b5f45a21c27b80210753e184e52708bb75a347bb
Generation 193       Oct 25 2021 21:29:18
  guix b0735c7
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: b0735c79b0d1d34117ec36d5dc5f14a3f9392bc1

News for channel 'guix'
  New `guix shell' command supersedes `guix environment'
    commit 746584e0ca200e7bf51b139ceb36c19ea81d6ef1

    A new `guix shell' command is now available.  It is similar to `guix environment', but with a
    more convenient interface (`guix environment' is deprecated but will remain available until
    May, 1st 2023).  The main difference compared to `guix environment' is that the "ad hoc" mode
    is the default.  Thus, to create an interactive environment containing Python, NumPy, and
    SciPy, you would run:
    
         guix shell python python-numpy python-scipy
    
    To get a development environment for, say, Inkscape, pass the `-D' flag:
    
         guix shell -D inkscape
    
    Another difference is that running `guix shell' without arguments loads `manifest.scm' or
    `guix.scm' for the current directory or an ancestor, provided you allowed it.  The command
    maintains a cache to speed up access to such environments.
    
    Run `info "(guix) Invoking guix shell"' for more information.

Generation 194       Nov 07 2021 23:40:30
  guix bd41e59
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: bd41e590dd24e54797fb8b6854c244efd4d12df5
--8<---------------cut here---------------end--------------->8---

One can pass ‘--details’ to get view new/upgraded packages:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix pull --detail -l
Generation 192       Oct 25 2021 00:12:47
  guix b5f45a2
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: b5f45a21c27b80210753e184e52708bb75a347bb
Generation 193       Oct 25 2021 21:29:18
  guix b0735c7
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: b0735c79b0d1d34117ec36d5dc5f14a3f9392bc1
  3 new packages: lttng-tools, vim-gitgutter, vim-mucomplete
  7 packages upgraded: flatpak@1.12.1, libportal@0.4, mspdebug@0.25-0.4c4d94e,
    p11-kit@0.24.0, reprotest@0.7.18, xdg-desktop-portal-gtk@1.10.0, xdg-desktop-portal@1.10.1

News for channel 'guix'
  New `guix shell' command supersedes `guix environment'
--8<---------------cut here---------------end--------------->8---

Last, ‘guix pull -l’ pipes its output to $PAGER by default.

Thoughts?

Ludo’.

Ludovic Courtès (4):
  pull: '--list-generations' doesn't list package changes by default.
  ui: 'with-paginated-output-port' gives access to the wrapped port.
  ui: 'display-generation' uses color when talking to a pager.
  pull: '--list-generations' pipes its output to the pager.

 doc/guix.texi         | 15 +++++++++------
 guix/scripts/pull.scm | 35 +++++++++++++++++++++++++++--------
 guix/ui.scm           | 24 ++++++++++++++++++++++--
 3 files changed, 58 insertions(+), 16 deletions(-)

-- 
2.34.0





^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#53909] [PATCH 1/4] pull: '--list-generations' doesn't list package changes by default.
  2022-02-09 22:12 [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default Ludovic Courtès
@ 2022-02-09 22:17 ` Ludovic Courtès
  2022-02-09 22:17   ` [bug#53909] [PATCH 2/4] ui: 'with-paginated-output-port' gives access to the wrapped port Ludovic Courtès
                     ` (3 more replies)
  2022-02-10 17:51 ` zimoun
  1 sibling, 4 replies; 10+ messages in thread
From: Ludovic Courtès @ 2022-02-09 22:17 UTC (permalink / raw)
  To: 53909; +Cc: Ludovic Courtès

* guix/scripts/pull.scm (show-help, %options): Add "--details".
(process-query): Honor it.
* doc/guix.texi (Invoking guix pull): Document it.
---
 doc/guix.texi         | 15 +++++++++------
 guix/scripts/pull.scm | 19 +++++++++++++++----
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 583ba1c61d..5ef750786f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4426,18 +4426,12 @@ Generation 2	Jun 11 2018 11:02:49
     repository URL: https://git.savannah.gnu.org/git/guix.git
     branch: origin/master
     commit: e0cc7f669bec22c37481dd03a7941c7d11a64f1d
-  2 new packages: keepalived, libnfnetlink
-  6 packages upgraded: emacs-nix-mode@@2.0.4,
-    guile2.0-guix@@0.14.0-12.77a1aac, guix@@0.14.0-12.77a1aac,
-    heimdal@@7.5.0, milkytracker@@1.02.00, nix@@2.0.4
 
 Generation 3	Jun 13 2018 23:31:07	(current)
   guix 844cc1c
     repository URL: https://git.savannah.gnu.org/git/guix.git
     branch: origin/master
     commit: 844cc1c8f394f03b404c5bb3aee086922373490c
-  28 new packages: emacs-helm-ls-git, emacs-helm-mu, @dots{}
-  69 packages upgraded: borg@@1.1.6, cheese@@3.28.0, @dots{}
 @end example
 
 @xref{Invoking guix describe, @command{guix describe}}, for other ways to
@@ -4507,6 +4501,15 @@ is provided, the subset of generations that match @var{pattern}.
 The syntax of @var{pattern} is the same as with @code{guix package
 --list-generations} (@pxref{Invoking guix package}).
 
+By default, this prints information about the channels used in each
+revision as well as the corresponding news entries.  If you pass
+@option{--details}, it will also print the list of packages added and
+upgraded in each generation compared to the previous one.
+
+@item --details
+Instruct @option{--list-generations} to display more information about
+the differences between subsequent generations---see above.
+
 @item --roll-back
 @cindex rolling back
 @cindex undoing transactions
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index fb8ce50fa7..707f1f0929 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013-2015, 2017-2022 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
@@ -104,6 +104,8 @@ (define (show-help)
   (display (G_ "
   -l, --list-generations[=PATTERN]
                          list generations matching PATTERN"))
+  (display (G_ "
+      --details          show details when listing generations"))
   (display (G_ "
       --roll-back        roll back to the previous generation"))
   (display (G_ "
@@ -138,6 +140,9 @@ (define %options
                  (lambda (opt name arg result)
                    (cons `(query list-generations ,arg)
                          result)))
+         (option '("details") #f #f
+                 (lambda (opt name arg result)
+                   (alist-cons 'details? #t result)))
          (option '("roll-back") #f #f
                  (lambda (opt name arg result)
                    (cons '(generation roll-back)
@@ -640,17 +645,23 @@ (define (package-alist generation)
 
 (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)))
@@ -754,7 +765,7 @@ (define (environment-variable)
 (define-command (guix-pull . args)
   (synopsis "pull the latest revision of Guix")
 
-  (define (no-arguments arg _‌)
+  (define (no-arguments arg _)
     (leave (G_ "~A: extraneous argument~%") arg))
 
   (with-error-handling
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#53909] [PATCH 2/4] ui: 'with-paginated-output-port' gives access to the wrapped port.
  2022-02-09 22:17 ` [bug#53909] [PATCH 1/4] pull: '--list-generations' doesn't list package changes " Ludovic Courtès
@ 2022-02-09 22:17   ` Ludovic Courtès
  2022-02-09 22:17   ` [bug#53909] [PATCH 3/4] ui: 'display-generation' uses color when talking to a pager Ludovic Courtès
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2022-02-09 22:17 UTC (permalink / raw)
  To: 53909; +Cc: Ludovic Courtès

* guix/ui.scm (pager-port-mapping): New variable.
(pager-wrapped-port): New procedure.
(call-with-paginated-output-port): Parameterize 'pager-port-mapping'.
---
 guix/ui.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index 093de1b4ab..d1f92ce7be 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -124,6 +124,7 @@ (define-module (guix ui)
             file-hyperlink
             location->hyperlink
 
+            pager-wrapped-port
             with-paginated-output-port
             relevance
             package-relevance
@@ -1665,6 +1666,20 @@ (define (package-relevance package regexps)
 zero means that PACKAGE does not match any of REGEXPS."
   (relevance package regexps %package-metrics))
 
+(define pager-port-mapping
+  ;; If a pager is being used, via 'with-paginated-output-port', this maps the
+  ;; pager port (pipe) to the underlying output port.
+  (make-parameter #f))
+
+(define* (pager-wrapped-port #:optional (port (current-output-port)))
+  "If PORT is a pipe to a pager created by 'with-paginated-output-port',
+return the underlying port.  Otherwise return #f."
+  (match (pager-port-mapping)
+    ((pager . wrapped)
+     (and (eq? pager port) wrapped))
+    (_
+     #f)))
+
 (define* (call-with-paginated-output-port proc
                                           #:key (less-options "FrX"))
   (let ((pager-command-line (or (getenv "GUIX_PAGER")
@@ -1691,7 +1706,10 @@ (define* (call-with-paginated-output-port proc
                                                      char-set:whitespace))))))
           (dynamic-wind
             (const #t)
-            (lambda () (proc pager))
+            (lambda ()
+              (parameterize ((pager-port-mapping
+                              (cons pager (current-output-port))))
+                (proc pager)))
             (lambda () (close-pipe pager))))
         (proc (current-output-port)))))
 
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#53909] [PATCH 3/4] ui: 'display-generation' uses color when talking to a pager.
  2022-02-09 22:17 ` [bug#53909] [PATCH 1/4] pull: '--list-generations' doesn't list package changes " Ludovic Courtès
  2022-02-09 22:17   ` [bug#53909] [PATCH 2/4] ui: 'with-paginated-output-port' gives access to the wrapped port Ludovic Courtès
@ 2022-02-09 22:17   ` Ludovic Courtès
  2022-02-09 22:17   ` [bug#53909] [PATCH 4/4] pull: '--list-generations' pipes its output to the pager Ludovic Courtès
  2022-02-10 17:21   ` [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default zimoun
  3 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2022-02-09 22:17 UTC (permalink / raw)
  To: 53909; +Cc: Ludovic Courtès

This makes sure that, say, 'guix pull -l' benefits from colors when its
output is piped to a pager, as long as the underlying terminal supports
it.

* guix/ui.scm (display-generation): Add second argument to 'highlight'.
---
 guix/ui.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index d1f92ce7be..238952723e 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1900,7 +1900,9 @@ (define (display-generation profile number)
            (link   (if (supports-hyperlinks?)
                        (cut file-hyperlink file <>)
                        identity))
-           (header (format #f (link (highlight (G_ "Generation ~a\t~a")))
+           (header (format #f (link (highlight (G_ "Generation ~a\t~a")
+                                               (or (pager-wrapped-port)
+                                                   (current-output-port))))
                            number
                            (date->string
                             (time-utc->date
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#53909] [PATCH 4/4] pull: '--list-generations' pipes its output to the pager.
  2022-02-09 22:17 ` [bug#53909] [PATCH 1/4] pull: '--list-generations' doesn't list package changes " Ludovic Courtès
  2022-02-09 22:17   ` [bug#53909] [PATCH 2/4] ui: 'with-paginated-output-port' gives access to the wrapped port Ludovic Courtès
  2022-02-09 22:17   ` [bug#53909] [PATCH 3/4] ui: 'display-generation' uses color when talking to a pager Ludovic Courtès
@ 2022-02-09 22:17   ` Ludovic Courtès
  2022-02-10 17:21   ` [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default zimoun
  3 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2022-02-09 22:17 UTC (permalink / raw)
  To: 53909; +Cc: Ludovic Courtès

* guix/scripts/pull.scm (process-query): For 'list-generations queries,
use 'with-paginated-output-port'.
(display-news-entry-title): Pass second argument to 'highlight'.
(display-news-entry): Pass second argument to 'dim'.
---
 guix/scripts/pull.scm | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 707f1f0929..7fe738229b 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -279,7 +279,8 @@ (define title
                   (texi->plain-text title))
 
                 ;; When Texinfo markup is invalid, display it as-is.
-                (const title)))))))
+                (const title)))
+             (or (pager-wrapped-port port) port)))))
 
 (define (display-news-entry entry channel language port)
   "Display ENTRY, a <channel-news-entry> from CHANNEL, in LANGUAGE, a language
@@ -291,7 +292,8 @@ (define commit
     (channel-news-entry-commit entry))
 
   (display-news-entry-title entry language port)
-  (format port (dim (G_ "    commit ~a~%"))
+  (format port (dim (G_ "    commit ~a~%")
+                    (or (pager-wrapped-port port) port))
           (if (supports-hyperlinks?)
               (channel-commit-hyperlink channel commit)
               commit))
@@ -673,14 +675,20 @@ (define (list-generations profile numbers)
              (raise (condition (&profile-not-found-error
                                 (profile profile)))))
             ((not pattern)
-             (list-generations profile (profile-generations profile)))
+             (with-paginated-output-port port
+               (with-output-to-port port
+                 (lambda ()
+                   (list-generations profile (profile-generations profile))))))
             ((matching-generations pattern profile)
              =>
              (match-lambda
                (()
                 (exit 1))
                ((numbers ...)
-                (list-generations profile numbers)))))))
+                (with-paginated-output-port port
+                  (with-output-to-port port
+                    (lambda ()
+                      (list-generations profile numbers))))))))))
     (('display-news)
      (display-news profile))))
 
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default
  2022-02-09 22:17 ` [bug#53909] [PATCH 1/4] pull: '--list-generations' doesn't list package changes " Ludovic Courtès
                     ` (2 preceding siblings ...)
  2022-02-09 22:17   ` [bug#53909] [PATCH 4/4] pull: '--list-generations' pipes its output to the pager Ludovic Courtès
@ 2022-02-10 17:21   ` zimoun
  2022-02-14 14:56     ` bug#53909: " Ludovic Courtès
  3 siblings, 1 reply; 10+ messages in thread
From: zimoun @ 2022-02-10 17:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 53909

[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: foo --]
[-- Type: text/x-diff, Size: 662 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 440 bytes --]


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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default
  2022-02-09 22:12 [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default Ludovic Courtès
  2022-02-09 22:17 ` [bug#53909] [PATCH 1/4] pull: '--list-generations' doesn't list package changes " Ludovic Courtès
@ 2022-02-10 17:51 ` zimoun
  2022-02-14 12:56   ` Ludovic Courtès
  1 sibling, 1 reply; 10+ messages in thread
From: zimoun @ 2022-02-10 17:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 53909

Hi Ludo,


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

> The other day on IRC zimoun noted that ‘guix pull -l’ doesn’t work for
> them because it prints those long package lists, which incidentally
> makes it slower.

My remark is based on the rate of changes.  Let assume that regular
users "pull" once a week – I even guess it is less frequent than that.

Here the number of additions this user would see for the last 10 weeks:

--8<---------------cut here---------------start------------->8---
$ for i in $(seq 10); do git log --after="$(($i + 1)) week ago" --before="$i week ago" --oneline | grep Add | wc -l; done
108
59
84
149
76
212
48
83
46
63
--8<---------------cut here---------------end--------------->8---

And for Update, it reads:

--8<---------------cut here---------------start------------->8---
106
115
103
247
261
134
167
99
100
145
--8<---------------cut here---------------end--------------->8---

Therefore, the current display of “guix pull -l” is not human readable.


> $ ./pre-inst-env guix pull --details -l

Note it hits bug#50472 [1].  Other said,

    guix pull -l --details

does not work as expected.

1:<http://issues.guix.gnu.org/issue/50472



> Ludovic Courtès (4):
>   pull: '--list-generations' doesn't list package changes by default.
>   ui: 'with-paginated-output-port' gives access to the wrapped port.
>   ui: 'display-generation' uses color when talking to a pager.
>   pull: '--list-generations' pipes its output to the pager.

Well, I am mainly running CLI with Emacs ’M-x shell’, so Emacs is my
pager. :-)  However, I have tried with xterm and PAGER=less, nothing is
different.  Do I miss something?



Cheers,
simon




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default
  2022-02-10 17:51 ` zimoun
@ 2022-02-14 12:56   ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2022-02-14 12:56 UTC (permalink / raw)
  To: zimoun; +Cc: 53909

Hi!

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

> On Wed, 09 Feb 2022 at 23:12, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> The other day on IRC zimoun noted that ‘guix pull -l’ doesn’t work for
>> them because it prints those long package lists, which incidentally
>> makes it slower.
>
> My remark is based on the rate of changes.  Let assume that regular
> users "pull" once a week – I even guess it is less frequent than that.
>
> Here the number of additions this user would see for the last 10 weeks:

[...]

> Therefore, the current display of “guix pull -l” is not human readable.

Yeah, though it’s searchable in $PAGER.

>> $ ./pre-inst-env guix pull --details -l
>
> Note it hits bug#50472 [1].  Other said,
>
>     guix pull -l --details
>
> does not work as expected.
>
> 1:<http://issues.guix.gnu.org/issue/50472

Right.

>> Ludovic Courtès (4):
>>   pull: '--list-generations' doesn't list package changes by default.
>>   ui: 'with-paginated-output-port' gives access to the wrapped port.
>>   ui: 'display-generation' uses color when talking to a pager.
>>   pull: '--list-generations' pipes its output to the pager.
>
> Well, I am mainly running CLI with Emacs ’M-x shell’, so Emacs is my
> pager. :-)  However, I have tried with xterm and PAGER=less, nothing is
> different.  Do I miss something?

The output gets piped to the pager now, which wasn’t the case before (I
tested in xterm FWIW).

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#53909: [PATCH 0/4] 'guix pull -l' no longer displays package lists by default
  2022-02-10 17:21   ` [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default zimoun
@ 2022-02-14 14:56     ` Ludovic Courtès
  2022-02-14 17:28       ` [bug#53909] " zimoun
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2022-02-14 14:56 UTC (permalink / raw)
  To: zimoun; +Cc: 53909-done

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’.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default
  2022-02-14 14:56     ` bug#53909: " Ludovic Courtès
@ 2022-02-14 17:28       ` zimoun
  0 siblings, 0 replies; 10+ messages in thread
From: zimoun @ 2022-02-14 17:28 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 53909-done

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




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-14 17:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-09 22:12 [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default Ludovic Courtès
2022-02-09 22:17 ` [bug#53909] [PATCH 1/4] pull: '--list-generations' doesn't list package changes " Ludovic Courtès
2022-02-09 22:17   ` [bug#53909] [PATCH 2/4] ui: 'with-paginated-output-port' gives access to the wrapped port Ludovic Courtès
2022-02-09 22:17   ` [bug#53909] [PATCH 3/4] ui: 'display-generation' uses color when talking to a pager Ludovic Courtès
2022-02-09 22:17   ` [bug#53909] [PATCH 4/4] pull: '--list-generations' pipes its output to the pager Ludovic Courtès
2022-02-10 17:21   ` [bug#53909] [PATCH 0/4] 'guix pull -l' no longer displays package lists by default zimoun
2022-02-14 14:56     ` bug#53909: " Ludovic Courtès
2022-02-14 17:28       ` [bug#53909] " zimoun
2022-02-10 17:51 ` zimoun
2022-02-14 12:56   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).