aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2023-10-31 21:01:10 +0100
committerChristopher Baines <mail@cbaines.net>2024-04-16 14:04:31 +0100
commit7156a36dec07d35c6b885a61727e34c98ebfdd68 (patch)
treeb766d7ece299fa84424e151ca60fee7cf463e450
parentd4552fc682fd3b0c048237ce35751bbae8c3f250 (diff)
downloadqa-frontpage-7156a36dec07d35c6b885a61727e34c98ebfdd68.tar
qa-frontpage-7156a36dec07d35c6b885a61727e34c98ebfdd68.tar.gz
Sort the patches before applying them to the git branch.
By default, the patches are not ordered. Because of the unreliability of e-mail delivery, they can be received completely out of order. Patchwork may also re-order them, and they may get ordered by commit author date (or, equivalently, e-mail Date header). Both possibilities lead to failure to apply patches if the order is incorrect for two patches that do not commute. The patch name contains a header: [bug#xxx,v12,i/n] where "i" is the variable part and indicates the patch number. Git pads "i" with zeros if needed. The string order of the names is thus the true commit order. * guix-qa-frontpage/manage-patch-branches.scm (create-branch-for-issue): Sort patches according to their "name".
-rw-r--r--guix-qa-frontpage/manage-patch-branches.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm
index 2c54fb4..c3ae256 100644
--- a/guix-qa-frontpage/manage-patch-branches.scm
+++ b/guix-qa-frontpage/manage-patch-branches.scm
@@ -243,8 +243,13 @@
(invoke-read-line "git" "show-ref" "--hash" base-tag)))
(let loop ((patch-data
- (vector->list
- (assoc-ref patchwork-series "patches")))
+ (stable-sort
+ (vector->list
+ (assoc-ref patchwork-series "patches"))
+ (lambda (patch-a patch-b)
+ (let ((name-a (assoc-ref patch-a "name"))
+ (name-b (assoc-ref patch-b "name")))
+ (string<? name-a name-b)))))
(results '()))
(if (null? patch-data)
(begin