unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append.
@ 2022-11-05 11:59 Vivien Kraus via Guix-patches via
  2022-11-05 11:59 ` [bug#59048] [PATCH v2] " Vivien Kraus via Guix-patches via
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Vivien Kraus via Guix-patches via @ 2022-11-05 11:59 UTC (permalink / raw)
  To: 59048

* doc/guix.texi (Defining Package Variants): Document the "prepend" clause of
modify-inputs first.
* guix/packages.scm (modify-inputs): use "prepend" in the docstring.
---
 doc/guix.texi     | 12 ++++++------
 guix/packages.scm |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7806b21a0f..f818643ecd 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8057,20 +8057,20 @@ following forms:
 @item (delete @var{name}@dots{})
 Delete from the inputs packages with the given @var{name}s (strings).
 
-@item (append @var{package}@dots{})
-Add @var{package}s to the end of the input list.
-
 @item (prepend @var{package}@dots{})
 Add @var{package}s to the front of the input list.
+
+@item (append @var{package}@dots{})
+Add @var{package}s to the end of the input list.
 @end table
 
 The example below removes the GMP and ACL inputs of Coreutils and adds
-libcap to the back of the input list:
+libcap to the front of the input list:
 
 @lisp
 (modify-inputs (package-inputs coreutils)
   (delete "gmp" "acl")
-  (append libcap))
+  (prepend libcap))
 @end lisp
 
 The example below replaces the @code{guile} package from the inputs of
@@ -8081,7 +8081,7 @@ The example below replaces the @code{guile} package from the inputs of
   (replace "guile" guile-2.2))
 @end lisp
 
-The last type of clause is @code{prepend}, to add inputs to the front of
+The last type of clause is @code{append}, to add inputs at the back of
 the list.
 @end deffn
 
diff --git a/guix/packages.scm b/guix/packages.scm
index 704b4ee710..502df7fdd1 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1176,9 +1176,9 @@ (define-syntax modify-inputs
 
   (modify-inputs (package-inputs coreutils)
     (delete \"gmp\" \"acl\")
-    (append libcap))
+    (prepend libcap))
 
-Other types of clauses include 'prepend' and 'replace'.
+Other types of clauses include 'append' and 'replace'.
 
 The first argument must be a labeled input list; the result is also a labeled
 input list."

base-commit: 84d239599a10f31e7d414d962ae25888ab21165c
-- 
2.38.0




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

* [bug#59048] [PATCH v2] guix: modify-input: Recommend prepend instead of append.
  2022-11-05 11:59 [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append Vivien Kraus via Guix-patches via
@ 2022-11-05 11:59 ` Vivien Kraus via Guix-patches via
  2022-11-21 14:36   ` bug#59048: " Christopher Baines
  2022-11-05 12:06 ` [bug#59048] [PATCH] " ( via Guix-patches via
  2022-11-05 19:17 ` Christopher Baines
  2 siblings, 1 reply; 7+ messages in thread
From: Vivien Kraus via Guix-patches via @ 2022-11-05 11:59 UTC (permalink / raw)
  To: 59048

Most packages use prepend rather than append. If guix has to decide on an
official policy, it should favor prepend.

* doc/guix.texi (Defining Package Variants): Document the "prepend" clause of
modify-inputs first.
* guix/packages.scm (modify-inputs): use "prepend" in the docstring.
---
 doc/guix.texi     | 12 ++++++------
 guix/packages.scm |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7806b21a0f..f818643ecd 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8057,20 +8057,20 @@ following forms:
 @item (delete @var{name}@dots{})
 Delete from the inputs packages with the given @var{name}s (strings).
 
-@item (append @var{package}@dots{})
-Add @var{package}s to the end of the input list.
-
 @item (prepend @var{package}@dots{})
 Add @var{package}s to the front of the input list.
+
+@item (append @var{package}@dots{})
+Add @var{package}s to the end of the input list.
 @end table
 
 The example below removes the GMP and ACL inputs of Coreutils and adds
-libcap to the back of the input list:
+libcap to the front of the input list:
 
 @lisp
 (modify-inputs (package-inputs coreutils)
   (delete "gmp" "acl")
-  (append libcap))
+  (prepend libcap))
 @end lisp
 
 The example below replaces the @code{guile} package from the inputs of
@@ -8081,7 +8081,7 @@ The example below replaces the @code{guile} package from the inputs of
   (replace "guile" guile-2.2))
 @end lisp
 
-The last type of clause is @code{prepend}, to add inputs to the front of
+The last type of clause is @code{append}, to add inputs at the back of
 the list.
 @end deffn
 
diff --git a/guix/packages.scm b/guix/packages.scm
index 704b4ee710..502df7fdd1 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1176,9 +1176,9 @@ (define-syntax modify-inputs
 
   (modify-inputs (package-inputs coreutils)
     (delete \"gmp\" \"acl\")
-    (append libcap))
+    (prepend libcap))
 
-Other types of clauses include 'prepend' and 'replace'.
+Other types of clauses include 'append' and 'replace'.
 
 The first argument must be a labeled input list; the result is also a labeled
 input list."

base-commit: e5a0381e6defd9c1ffd1b57d9de7f31636c87b68
-- 
2.38.0




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

* [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append.
  2022-11-05 11:59 [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append Vivien Kraus via Guix-patches via
  2022-11-05 11:59 ` [bug#59048] [PATCH v2] " Vivien Kraus via Guix-patches via
@ 2022-11-05 12:06 ` ( via Guix-patches via
  2022-11-05 19:17 ` Christopher Baines
  2 siblings, 0 replies; 7+ messages in thread
From: ( via Guix-patches via @ 2022-11-05 12:06 UTC (permalink / raw)
  To: Vivien Kraus, 59048

On Sat Nov 5, 2022 at 11:59 AM GMT, Vivien Kraus via Guix-patches via wrote:
> * doc/guix.texi (Defining Package Variants): Document the "prepend" clause of
> modify-inputs first.
> * guix/packages.scm (modify-inputs): use "prepend" in the docstring.

LGTM :)

    -- (




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

* [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append.
  2022-11-05 11:59 [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append Vivien Kraus via Guix-patches via
  2022-11-05 11:59 ` [bug#59048] [PATCH v2] " Vivien Kraus via Guix-patches via
  2022-11-05 12:06 ` [bug#59048] [PATCH] " ( via Guix-patches via
@ 2022-11-05 19:17 ` Christopher Baines
  2022-11-05 19:47   ` Vivien Kraus via Guix-patches via
  2 siblings, 1 reply; 7+ messages in thread
From: Christopher Baines @ 2022-11-05 19:17 UTC (permalink / raw)
  To: Vivien Kraus; +Cc: 59048

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


Vivien Kraus via Guix-patches via <guix-patches@gnu.org> writes:

> * doc/guix.texi (Defining Package Variants): Document the "prepend" clause of
> modify-inputs first.
> * guix/packages.scm (modify-inputs): use "prepend" in the docstring.
> ---
>  doc/guix.texi     | 12 ++++++------
>  guix/packages.scm |  4 ++--
>  2 files changed, 8 insertions(+), 8 deletions(-)

This seems OK, but it would be good to know why you're wanting to change
this? In other words, how does this make things better?

This information would be good to have in the commit message (I usually
just write a sentance/paragraph above the changelog).

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

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

* [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append.
  2022-11-05 19:17 ` Christopher Baines
@ 2022-11-05 19:47   ` Vivien Kraus via Guix-patches via
  2022-11-05 19:51     ` ( via Guix-patches via
  0 siblings, 1 reply; 7+ messages in thread
From: Vivien Kraus via Guix-patches via @ 2022-11-05 19:47 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 59048, paren

Hello!

Le samedi 05 novembre 2022 à 20:17 +0100, Christopher Baines a écrit :
> 
> Vivien Kraus via Guix-patches via <guix-patches@gnu.org> writes:
> 
> > * doc/guix.texi (Defining Package Variants): Document the "prepend"
> > clause of
> > modify-inputs first.
> > * guix/packages.scm (modify-inputs): use "prepend" in the
> > docstring.
> > ---
> >  doc/guix.texi     | 12 ++++++------
> >  guix/packages.scm |  4 ++--
> >  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> This seems OK, but it would be good to know why you're wanting to
> change
> this? In other words, how does this make things better?

I’m not sure of anything. What I gathered so far is:

- it could be more efficient;
- most instances in the packages use prepend rather than append:

$ grep -R '(modify-inputs' gnu -A 3 | grep '(append' | wc -l
34
$ grep -R '(modify-inputs' gnu -A 3 | grep '(prepend' | wc -l
128

I’m inviting ( in the discussion because the issue was raised in an IRC
discussion about a previous patch of mine (test).

Now, the old way I would reply to this message would be to attach an
updated patch, but since I have been told to send patches as emails
instead of attachments I don’t know how to proceed.

Vivien




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

* [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append.
  2022-11-05 19:47   ` Vivien Kraus via Guix-patches via
@ 2022-11-05 19:51     ` ( via Guix-patches via
  0 siblings, 0 replies; 7+ messages in thread
From: ( via Guix-patches via @ 2022-11-05 19:51 UTC (permalink / raw)
  To: Vivien Kraus, Christopher Baines; +Cc: 59048

On Sat Nov 5, 2022 at 7:47 PM GMT, Vivien Kraus wrote:
> Now, the old way I would reply to this message would be to attach an
> updated patch, but since I have been told to send patches as emails
> instead of attachments I don’t know how to proceed.

The "Single Patches" section tells you how to send a v2 patchset; this
applies equally for multiple patches:

  If you need to send a revised patch, don’t resend it like this or send a
  “fix” patch to be applied on top of the last one; instead, use git commit -a
  or git rebase to modify the commit, and use the ISSUE_NUMBER@debbugs.gnu.org
  address and the -v flag with git send-email.

    $ git commit -a
    $ git send-email -1 -a --base=auto -v REVISION \
        --to=ISSUE_NUMBER@debbugs.gnu.org


    -- (




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

* bug#59048: [PATCH v2] guix: modify-input: Recommend prepend instead of append.
  2022-11-05 11:59 ` [bug#59048] [PATCH v2] " Vivien Kraus via Guix-patches via
@ 2022-11-21 14:36   ` Christopher Baines
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher Baines @ 2022-11-21 14:36 UTC (permalink / raw)
  To: Vivien Kraus; +Cc: 59048-done, guix-patches

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


Vivien Kraus via Guix-patches via <guix-patches@gnu.org> writes:

> Most packages use prepend rather than append. If guix has to decide on an
> official policy, it should favor prepend.
>
> * doc/guix.texi (Defining Package Variants): Document the "prepend" clause of
> modify-inputs first.
> * guix/packages.scm (modify-inputs): use "prepend" in the docstring.
> ---
>  doc/guix.texi     | 12 ++++++------
>  guix/packages.scm |  4 ++--
>  2 files changed, 8 insertions(+), 8 deletions(-)

I've now pushed this to master as
9283c80e604324f5449b5a8daf94285cdc6a8604.

For some reason, I think I pushed the v1 of the patch, that's my bad. I
think the changes are still fine, it's just I missed the commit message
changes here.

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

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

end of thread, other threads:[~2022-11-21 14:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-05 11:59 [bug#59048] [PATCH] guix: modify-input: Recommend prepend instead of append Vivien Kraus via Guix-patches via
2022-11-05 11:59 ` [bug#59048] [PATCH v2] " Vivien Kraus via Guix-patches via
2022-11-21 14:36   ` bug#59048: " Christopher Baines
2022-11-05 12:06 ` [bug#59048] [PATCH] " ( via Guix-patches via
2022-11-05 19:17 ` Christopher Baines
2022-11-05 19:47   ` Vivien Kraus via Guix-patches via
2022-11-05 19:51     ` ( via Guix-patches via

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