GNU bug report logs -
#54307
[PATCH 0/2] Highlight headings showing what to build/download
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Wed, 9 Mar 2022 09:58:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54307 in the body.
You can then email your comments to 54307 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
julien <at> lepiller.eu, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org
:
bug#54307
; Package
guix-patches
.
(Wed, 09 Mar 2022 09:58:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
julien <at> lepiller.eu, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org
.
(Wed, 09 Mar 2022 09:58:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello Guix!
These patches color headings in the output of ‘show-what-to-build’:
The following derivations will be built:
is now printed in bold magenta, and:
X MB will be downloaded:
is printed in bold (this message is only visible at ‘-v2’.)
The reason it wasn’t done before is that it invalidates translations.
I think now is a good time as we prepare a release.
Julien, Maxim: WDYT?
Ludo’.
Ludovic Courtès (2):
ui: 'show-what-to-build' highlights "The following [...] will be
built".
ui: 'show-what-to-build' highlights "would be downloaded" headings.
guix/colors.scm | 4 +-
guix/ui.scm | 98 +++++++++++++++++++++++++++++--------------------
2 files changed, 61 insertions(+), 41 deletions(-)
base-commit: 0d14f8a8702ec8016ac58e5778a754b3105ef418
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54307
; Package
guix-patches
.
(Wed, 09 Mar 2022 10:13:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 54307 <at> debbugs.gnu.org (full text, mbox):
* guix/ui.scm (show-what-to-build): Highlight "X MB would be downloaded".
---
guix/ui.scm | 74 +++++++++++++++++++++++++++++++----------------------
1 file changed, 44 insertions(+), 30 deletions(-)
diff --git a/guix/ui.scm b/guix/ui.scm
index 8e4e3e2dfc..6c194eb3c9 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1041,21 +1041,28 @@ (define display-download-size?
(map colorized-store-item build)))
(cond ((>= verbosity 2)
(if display-download-size?
- (format (current-error-port)
- ;; TRANSLATORS: "MB" is for "megabyte"; it should be
- ;; translated to the corresponding abbreviation.
- (G_ "~:[~,1h MB would be downloaded:~%~{ ~a~%~}~;~]")
- (null? download)
- download-size
- (map (compose colorized-store-item substitutable-path)
- download))
- (format (current-error-port)
- (N_ "~:[The following file would be downloaded:~%~{ ~a~%~}~;~]"
- "~:[The following files would be downloaded:~%~{ ~a~%~}~;~]"
- (length download))
- (null? download)
- (map (compose colorized-store-item substitutable-path)
- download)))
+ (begin
+ (format (current-error-port)
+ (highlight
+ ;; TRANSLATORS: "MB" is for "megabyte"; it
+ ;; should be translated to the corresponding
+ ;; abbreviation.
+ (G_ "~:[~,1h MB would be downloaded:~%~;~]"))
+ (null? download)
+ download-size)
+ (format (current-error-port) "~{ ~a~%~}"
+ (map (compose colorized-store-item substitutable-path)
+ download)))
+ (begin
+ (format (current-error-port)
+ (highlight
+ (N_ "~:[The following file would be downloaded:~%~;~]"
+ "~:[The following files would be downloaded:~%~;~]"
+ (length download)))
+ (null? download))
+ (format (current-error-port) "~{ ~a~%~}"
+ (map (compose colorized-store-item substitutable-path)
+ download))))
(format (current-error-port)
(N_ "~:[The following graft would be made:~%~{ ~a~%~}~;~]"
"~:[The following grafts would be made:~%~{ ~a~%~}~;~]"
@@ -1094,21 +1101,28 @@ (define display-download-size?
(map colorized-store-item build)))
(cond ((>= verbosity 2)
(if display-download-size?
- (format (current-error-port)
- ;; TRANSLATORS: "MB" is for "megabyte"; it should be
- ;; translated to the corresponding abbreviation.
- (G_ "~:[~,1h MB will be downloaded:~%~{ ~a~%~}~;~]")
- (null? download)
- download-size
- (map (compose colorized-store-item substitutable-path)
- download))
- (format (current-error-port)
- (N_ "~:[The following file will be downloaded:~%~{ ~a~%~}~;~]"
- "~:[The following files will be downloaded:~%~{ ~a~%~}~;~]"
- (length download))
- (null? download)
- (map (compose colorized-store-item substitutable-path)
- download)))
+ (begin
+ (format (current-error-port)
+ (highlight
+ ;; TRANSLATORS: "MB" is for "megabyte"; it
+ ;; should be translated to the corresponding
+ ;; abbreviation.
+ (G_ "~:[~,1h MB will be downloaded:~%~;~]"))
+ (null? download)
+ download-size)
+ (format (current-error-port) "~{ ~a~%~}"
+ (map (compose colorized-store-item substitutable-path)
+ download)))
+ (begin
+ (format (current-error-port)
+ (highlight
+ (N_ "~:[The following file will be downloaded:~%~;~]"
+ "~:[The following files will be downloaded:~%~;~]"
+ (length download)))
+ (null? download))
+ (format (current-error-port) "~{ ~a~%~}"
+ (map (compose colorized-store-item substitutable-path)
+ download))))
(format (current-error-port)
(N_ "~:[The following graft will be made:~%~{ ~a~%~}~;~]"
"~:[The following grafts will be made:~%~{ ~a~%~}~;~]"
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54307
; Package
guix-patches
.
(Wed, 09 Mar 2022 10:13:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 54307 <at> debbugs.gnu.org (full text, mbox):
* guix/colors.scm (highlight/warn): New procedure.
* guix/ui.scm (show-what-to-build): Use 'highlight/warn' when displaying
what would/will be built.
---
guix/colors.scm | 4 +++-
guix/ui.scm | 24 ++++++++++++++----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/guix/colors.scm b/guix/colors.scm
index 3031f54799..ae0a583d94 100644
--- a/guix/colors.scm
+++ b/guix/colors.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2013, 2014 Free Software Foundation, Inc.
;;; Copyright © 2018 Sahithi Yarlagadda <sahi <at> swecha.net>
;;; Copyright © 2018 Ricardo Wurmus <rekado <at> elephly.net>
-;;; Copyright © 2017, 2018, 2019 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2017, 2018, 2019, 2022 Ludovic Courtès <ludo <at> gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -31,6 +31,7 @@ (define-module (guix colors)
colorize-string
highlight
+ highlight/warn
dim
color-rules
@@ -143,6 +144,7 @@ (define (coloring-procedure color)
str)))
(define highlight (coloring-procedure (color BOLD)))
+(define highlight/warn (coloring-procedure (color BOLD MAGENTA)))
(define dim (coloring-procedure (color DARK)))
(define (colorize-matches rules)
diff --git a/guix/ui.scm b/guix/ui.scm
index 238952723e..8e4e3e2dfc 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1031,12 +1031,14 @@ (define display-download-size?
;; Unfortunately, this is hardly avoidable for proper i18n.
(if dry-run?
(begin
- (unless (zero? verbosity)
+ (unless (or (zero? verbosity) (null? build))
(format (current-error-port)
- (N_ "~:[The following derivation would be built:~%~{ ~a~%~}~;~]"
- "~:[The following derivations would be built:~%~{ ~a~%~}~;~]"
- (length build))
- (null? build) (map colorized-store-item build)))
+ (highlight/warn
+ (N_ "The following derivation would be built:~%"
+ "The following derivations would be built:~%"
+ (length build))))
+ (format (current-error-port) "~{ ~a~%~}"
+ (map colorized-store-item build)))
(cond ((>= verbosity 2)
(if display-download-size?
(format (current-error-port)
@@ -1082,12 +1084,14 @@ (define display-download-size?
(null? download) (length download))))))
(begin
- (unless (zero? verbosity)
+ (unless (or (zero? verbosity) (null? build))
(format (current-error-port)
- (N_ "~:[The following derivation will be built:~%~{ ~a~%~}~;~]"
- "~:[The following derivations will be built:~%~{ ~a~%~}~;~]"
- (length build))
- (null? build) (map colorized-store-item build)))
+ (highlight/warn
+ (N_ "The following derivation will be built:~%"
+ "The following derivations will be built:~%"
+ (length build))))
+ (format (current-error-port) "~{ ~a~%~}"
+ (map colorized-store-item build)))
(cond ((>= verbosity 2)
(if display-download-size?
(format (current-error-port)
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54307
; Package
guix-patches
.
(Wed, 09 Mar 2022 10:53:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 54307 <at> debbugs.gnu.org (full text, mbox):
Am Mittwoch, dem 09.03.2022 um 11:12 +0100 schrieb Ludovic Courtès:
> * guix/colors.scm (highlight/warn): New procedure.
> * guix/ui.scm (show-what-to-build): Use 'highlight/warn' when
> displaying
> what would/will be built.
highlight/warn sounds somewhat misleading for this use-case. Should
this be highlight/info instead?
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54307
; Package
guix-patches
.
(Thu, 10 Mar 2022 10:20:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 54307 <at> debbugs.gnu.org (full text, mbox):
Hi,
Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> skribis:
> Am Mittwoch, dem 09.03.2022 um 11:12 +0100 schrieb Ludovic Courtès:
>> * guix/colors.scm (highlight/warn): New procedure.
>> * guix/ui.scm (show-what-to-build): Use 'highlight/warn' when
>> displaying
>> what would/will be built.
> highlight/warn sounds somewhat misleading for this use-case. Should
> this be highlight/info instead?
I agree “warn” is misleading, but I don’t find “info” any clearer. :-)
Maybe ‘highlight-more’ or something?
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54307
; Package
guix-patches
.
(Thu, 10 Mar 2022 10:47:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 54307 <at> debbugs.gnu.org (full text, mbox):
Am Donnerstag, dem 10.03.2022 um 11:19 +0100 schrieb Ludovic Courtès:
> Hi,
>
> Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> skribis:
>
> > Am Mittwoch, dem 09.03.2022 um 11:12 +0100 schrieb Ludovic Courtès:
> > > * guix/colors.scm (highlight/warn): New procedure.
> > > * guix/ui.scm (show-what-to-build): Use 'highlight/warn' when
> > > displaying
> > > what would/will be built.
> > highlight/warn sounds somewhat misleading for this use-case.
> > Should
> > this be highlight/info instead?
>
> I agree “warn” is misleading, but I don’t find “info” any clearer.
> :-)
>
> Maybe ‘highlight-more’ or something?
Highlight more than what? Looking at (guix diagnostics) we currently
have merely bold for info, bold magenta for warning and bold red for
error. On a related note, (guix diagnostics) appears a little over-
engineered; it's mostly there to highlight the diagnostic prefix, but
it would also highlight any other non-whitespace argument... is that
really useful?
Anyway, I would suggest using a less "offensive" colour to indicate how
much is being downloaded/built. Using red or magenta in this case
would signal an error when that's actually the expected behaviour. My
personal colouring bias would tend towards cyan or green here, although
green itself is already used to signal success and might not be a good
idea either.
While highlight/info on its own really doesn't make sense, it'd make
more sense if we also defined %warning-color, %info-color, %error-color
in colors and simply used them in diagnostics rather than the other way
round and also defined highlight/warning and highlight/error to
complete the pattern. Once we figure out what we want to do with the
diagnostics, we could even drop them from the exports if the coloring
procedures can be used in their stead.
Cheers
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54307
; Package
guix-patches
.
(Sun, 13 Mar 2022 22:02:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 54307 <at> debbugs.gnu.org (full text, mbox):
Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> skribis:
> Am Donnerstag, dem 10.03.2022 um 11:19 +0100 schrieb Ludovic Courtès:
>> Hi,
>>
>> Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> skribis:
>>
>> > Am Mittwoch, dem 09.03.2022 um 11:12 +0100 schrieb Ludovic Courtès:
>> > > * guix/colors.scm (highlight/warn): New procedure.
>> > > * guix/ui.scm (show-what-to-build): Use 'highlight/warn' when
>> > > displaying
>> > > what would/will be built.
>> > highlight/warn sounds somewhat misleading for this use-case.
>> > Should
>> > this be highlight/info instead?
>>
>> I agree “warn” is misleading, but I don’t find “info” any clearer.
>> :-)
>>
>> Maybe ‘highlight-more’ or something?
> Highlight more than what?
More than just bold; the goal is to make “The following derivations will
be built” more prominent.
[...]
> Anyway, I would suggest using a less "offensive" colour to indicate how
> much is being downloaded/built.
What’s downloaded is still being displayed as bold with the default
color (black or white). The only thing that changes colors is the
sentence above.
Thing is we have few colors at hand (see (guix colors)) and we need one
that works well both with a white and with a dark background. So…
So far magenta is used for warnings, which is consistent with the intent
here.
WDYT?
Thanks,
Ludo’.
Reply sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
You have taken responsibility.
(Fri, 18 Mar 2022 15:11:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
bug acknowledged by developer.
(Fri, 18 Mar 2022 15:11:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 54307-done <at> debbugs.gnu.org (full text, mbox):
Hi!
Ludovic Courtès <ludo <at> gnu.org> skribis:
> ui: 'show-what-to-build' highlights "The following [...] will be
> built".
> ui: 'show-what-to-build' highlights "would be downloaded" headings.
I went ahead and pushed these as
625fa3cfe8c57cd5624608d2478c8c6be4c69c3b.
Of course we can still discuss color and name choices :-). The
important part for me was to put the base in place so translations can
be updated before the release.
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 16 Apr 2022 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 65 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.