Subject: [PATCH 2/2] help: ensure &keys_uniq follows sort -u

From: Amisha Chhajed <[email-masked]>
Date: Thu, 12 Feb 2026 09:40:17 +0530

From: Amisha Chhajed <[email-masked]>

uniqueness operation of &keys_uniq depends on the sort operation executed
for &keys this might introduce regressions in future when the logic of
forming &keys_uniq from &keys is changed.

add string_list_sort_u operation for &keys_uniq after the processing of
&keys so it follows the expected sort -u behaviour.

Signed-off-by: Amisha Chhajed <[email-masked]>
---
 builtin/help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/help.c b/builtin/help.c
index c09cbc8912..0c9c007214 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -196,7 +196,7 @@ static void list_config_help(enum show_config_type type)
 
 	}
 	string_list_clear(&keys, 0);
-	string_list_remove_duplicates(&keys_uniq, 0);
+	string_list_sort_u(&keys_uniq, 0);
 	for_each_string_list_item(item, &keys_uniq)
 		puts(item->string);
 	string_list_clear(&keys_uniq, 0);
-- 
2.52.0