From: Amisha Chhajed <amishhhaaaa@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Derrick Stolee <stolee@gmail.com>,
Elijah Newren <newren@gmail.com>, Jeff King <peff@peff.net>,
amisha <amishhhaaaa@gmail.com>
Subject: [RFC PATCH 0/2] Adding string_list_sort_u to replace combined calls of string_list_sort and string_list_remove_duplicates calls.
Date: Thu, 22 Jan 2026 22:45:21 +0530 [thread overview]
Message-ID: <20260122171523.94234-1-amishhhaaaa@gmail.com> (raw)
Following up with Junio's suggestion in
https://lore.kernel.org/git/xmqqqzrp74q3.fsf@gitster.g/, 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
next reply other threads:[~2026-01-22 17:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 17:15 Amisha Chhajed [this message]
2026-01-22 17:15 ` [RFC PATCH 1/2] Adding string_list_sort_u which sorts a list then deduplicates it Amisha Chhajed
2026-01-22 22:07 ` Junio C Hamano
2026-01-25 20:23 ` Amisha Chhajed
2026-01-22 17:15 ` [RFC PATCH 2/2] Replacing calls of string_list_sort and string_list_remove_duplicates with the combined variant string_list_u Amisha Chhajed
2026-01-22 22:19 ` Junio C Hamano
2026-01-22 22:09 ` [RFC PATCH 0/2] Adding string_list_sort_u to replace combined calls of string_list_sort and string_list_remove_duplicates calls Junio C Hamano
2026-01-25 20:14 ` [PATCH 1/2] u-string-list: add unit tests for string-list methods Amisha Chhajed
2026-01-25 20:15 ` [PATCH 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Amisha Chhajed
2026-01-29 12:12 ` [PATCH v3 1/2] u-string-list: add unit tests for string-list methods Amisha Chhajed
2026-01-29 12:12 ` [PATCH v3 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Amisha Chhajed
2026-01-29 12:14 ` [PATCH v3 1/2] u-string-list: add unit tests for string-list methods Amisha Chhajed
2026-01-30 19:51 ` [PATCH 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Kristoffer Haugsbakk
2026-01-30 21:45 ` Junio C Hamano
2026-01-26 7:12 ` [PATCH 1/2] u-string-list: add unit tests for string-list methods Junio C Hamano
2026-01-26 18:57 ` Amisha Chhajed
2026-01-26 19:12 ` Junio C Hamano
2026-01-25 20:17 ` Amisha Chhajed
2026-01-25 20:17 ` [PATCH 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Amisha Chhajed
2026-01-26 18:56 ` [PATCH v2 1/2] u-string-list: add unit tests for string-list methods Amisha Chhajed
2026-01-26 18:56 ` [PATCH v2 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Amisha Chhajed
2026-01-26 20:11 ` Junio C Hamano
2026-01-27 1:27 ` Amisha Chhajed
2026-01-26 19:50 ` [PATCH v2 1/2] u-string-list: add unit tests for string-list methods Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260122171523.94234-1-amishhhaaaa@gmail.com \
--to=amishhhaaaa@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox