Subject: [RFC PATCH 0/2] Adding string_list_sort_u to replace combined calls of string_list_sort and string_list_remove_duplicates calls.

From: Amisha Chhajed <[email-masked]>
Date: Thu, 22 Jan 2026 22:45:21 +0530

Following up with Junio's suggestion in 
https://lore.kernel.org/git/[email-masked]/, calls to 
string_list_remove_duplicates are almost always preceeded by string_list_sort
which can be coupled into a single method.

There are places, for example the call of string_list_remove_duplicates
in pack-objects.c where removal of that line causes no test failures,
however removal of string_list_sort_u version did because removing sort
is a more catchable behaviour by the current tests, this might improve
the case where we were unsure why removing string_list_remove_duplicates
caused no test failures.

I was unable to write unit tests for this new method in this RFC PATCH
since I was quite unsure why no unit tests were present for string_list_sort
and string_list_insert.

Amisha Chhajed (2):
  Adding string_list_sort_u which sorts a list then deduplicates it.
  Replacing calls of string_list_sort and string_list_remove_duplicates
    with the combined variant string_list_u.

 builtin/clone.c           | 3 +--
 builtin/fast-export.c     | 3 +--
 builtin/pack-objects.c    | 6 ++----
 builtin/sparse-checkout.c | 6 ++----
 help.c                    | 3 +--
 notes.c                   | 3 +--
 string-list.c             | 6 ++++++
 string-list.h             | 6 ++++++
 8 files changed, 20 insertions(+), 16 deletions(-)

-- 
2.51.0