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>
This commit is contained in:
Hartmut Goebel 2025-10-24 20:18:04 +02:00 committed by Ludovic Courtès
parent 81a066eb91
commit ef04d631bd
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -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