Skip to content

RFC Adding string_list_sort_u to replace combined calls of string_list_sort and string_list_remove_duplicates calls.

Amisha Chhajed git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Adding string_list_sort_u which sorts a list then deduplicates it.string-list.c string-list.h+12 -02 replies
1/2u-string-list: add unit tests for string-list methodst/unit-tests/u-string-list.c+197 -03 replies
1/2u-string-list: add unit tests for string-list methodst/unit-tests/u-string-list.c+197 -00 replies
2/2Replacing calls of string_list_sort and string_list_remove_duplicates with the combined variant string_list_u.builtin/clone.c builtin/fast-export.c builtin/pack-objects.c +3 more+8 -161 reply
2/2string-list: add string_list_sort_u() that mimics "sort -u"builtin/clone.c builtin/fast-export.c builtin/pack-objects.c +6 more+54 -165 replies
2/2string-list: add string_list_sort_u() that mimics "sort -u"builtin/clone.c builtin/fast-export.c builtin/pack-objects.c +6 more+54 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

Following up with Junio's suggestion in
https://lore.kernel.org/git/[email protected]/, 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(-)
Signature · 1 line
2.51.0