Skip to content

Commit c4a78b8

Browse files
committed
hackorum-patch: fix sorting bug when the patch title contained numbers
1 parent d3f464c commit c4a78b8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

public/scripts/hackorum-patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class HackorumPatch
106106
def sort_patch_files(files)
107107
files.sort_by do |f|
108108
basename = File.basename(f)
109-
# Match sequence number: digits followed by hyphen before the actual patch name
109+
# Match sequence number: first 4+ digit group followed by a hyphen
110110
# e.g., "0001-subject.patch" or "nocfbot.v2-0005-subject.patch"
111-
if basename =~ /(\d+)-[^-]+\.(patch|diff)$/i
111+
if basename =~ /(\d{4,})-.*\.(patch|diff)$/i
112112
[$1.to_i, basename]
113113
else
114114
# Fallback: sort alphabetically but after numbered patches

0 commit comments

Comments
 (0)