diff mbox series

[bug#59048] guix: modify-input: Recommend prepend instead of append.

Message ID 7c0fbbe321c736a5757c637b33bf3a9909a6f63e.camel@planete-kraus.eu
State New
Headers show
Series [bug#59048] guix: modify-input: Recommend prepend instead of append. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success
cbaines/issue success View issue

Commit Message

Vivien Kraus Nov. 5, 2022, 11:59 a.m. UTC
* 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(-)


base-commit: 84d239599a10f31e7d414d962ae25888ab21165c

Comments

\( Nov. 5, 2022, 12:06 p.m. UTC | #1
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 :)

    -- (
Christopher Baines Nov. 5, 2022, 7:17 p.m. UTC | #2
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
Vivien Kraus Nov. 5, 2022, 7:47 p.m. UTC | #3
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
\( Nov. 5, 2022, 7:51 p.m. UTC | #4
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


    -- (
diff mbox series

Patch

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