~ruther/guix-local

ef04d631bdfa6bb5c67efc92a1cd43847a111001 — Hartmut Goebel 6 months ago 81a066e
etc: committer: Fix crashes when inputs only change order.

* etc/committer.scm.in (change-commit-message): Fix handling when package
inputs are the same but in different order.

Change-Id: I8760a7c8fb57c82d657b239a50c973ba81f9781f
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
1 files changed, 17 insertions(+), 16 deletions(-)

M etc/committer.scm.in
M etc/committer.scm.in => etc/committer.scm.in +17 -16
@@ 303,22 303,23 @@ corresponding to the top-level definition containing the staged changes."
                (or (equal? old-values new-values)
                    (let ((removed (lset-difference equal? old-values new-values))
                          (added (lset-difference equal? new-values old-values)))
                      (format port
                              "[~a]: ~a~%" field
                              (break-string
                               ;; A dependency can be a list of (pkg output).
                               (match (list (map object->string removed)
                                            (map object->string added))
                                 ((() added)
                                  (format #f "Add ~a."
                                          (listify added)))
                                 ((removed ())
                                  (format #f "Remove ~a."
                                          (listify removed)))
                                 ((removed added)
                                  (format #f "Remove ~a; add ~a."
                                          (listify removed)
                                          (listify added))))))))))
                      (unless (and (null? added) (null? removed))
                        (format port
                                "[~a]: ~a~%" field
                                (break-string
                                 ;; A dependency can be a list of (pkg output).
                                 (match (list (map object->string removed)
                                              (map object->string added))
                                   ((() added)
                                    (format #f "Add ~a."
                                            (listify added)))
                                   ((removed ())
                                    (format #f "Remove ~a."
                                            (listify removed)))
                                   ((removed added)
                                    (format #f "Remove ~a; add ~a."
                                            (listify removed)
                                            (listify added)))))))))))
            '(inputs propagated-inputs native-inputs)))

(define* (add-commit-message file-name variable-name