<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/unit-tests/u-string-list.c, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2026-01-29T17:32:50Z</updated>
<entry>
<title>string-list: add string_list_sort_u() that mimics "sort -u"</title>
<updated>2026-01-29T17:32:50Z</updated>
<author>
<name>Amisha Chhajed</name>
<email>amishhhaaaa@gmail.com</email>
</author>
<published>2026-01-29T12:12:20Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2e711acfbdfc0fedf631688d78cde153ba835c93'/>
<id>urn:sha1:2e711acfbdfc0fedf631688d78cde153ba835c93</id>
<content type='text'>
Many callsites of string_list_remove_duplicates() call it
immdediately after calling string_list_sort(), understandably
as the former requires string-list to be sorted, it is clear
that these places are sorting only to remove duplicates and
for no other reason.

Introduce a helper function string_list_sort_u that combines
these two calls that often appear together, to simplify
these callsites. Replace the current calls of those methods with
string_list_sort_u().

Signed-off-by: Amisha Chhajed &lt;amishhhaaaa@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>u-string-list: add unit tests for string-list methods</title>
<updated>2026-01-29T17:32:50Z</updated>
<author>
<name>Amisha Chhajed</name>
<email>amishhhaaaa@gmail.com</email>
</author>
<published>2026-01-29T12:12:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=208642cfbb53781602af1fa77c67322c0aab0ad9'/>
<id>urn:sha1:208642cfbb53781602af1fa77c67322c0aab0ad9</id>
<content type='text'>
Unit tests in u-string-list.c does not cover several methods
in string-list, this gap in coverage makes it difficult to
ensure no regressions are introduced in future changes.

Add unit tests for the following methods to enhance coverage:
string_list_remove_empty_items()
unsorted_string_list_has_string()
unsorted_string_list_delete_item()
string_list_has_string()
string_list_insert()
string_list_sort()
string_list_remove()

Signed-off-by: Amisha Chhajed &lt;amishhhaaaa@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list: optionally omit empty string pieces in string_list_split*()</title>
<updated>2025-08-03T05:34:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-01T22:04:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=27531efa41cfa882473513dd93e696a16f6eb87b'/>
<id>urn:sha1:27531efa41cfa882473513dd93e696a16f6eb87b</id>
<content type='text'>
Teach the unified split_string() machinery a new flag bit,
STRING_LIST_SPLIT_NONEMPTY, to cause empty split pieces to be
omitted from the resulting string list.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list: optionally trim string pieces split by string_list_split*()</title>
<updated>2025-08-03T05:34:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-01T22:04:20Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=576454974165d51b7e39c0608cde1c84978f1a8a'/>
<id>urn:sha1:576454974165d51b7e39c0608cde1c84978f1a8a</id>
<content type='text'>
Teach the unified split_string() to take an optional "flags" word,
and define the first flag STRING_LIST_SPLIT_TRIM to cause the split
pieces to be trimmed before they are placed in the string list.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list: align string_list_split() with its _in_place() counterpart</title>
<updated>2025-08-03T05:29:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-01T22:04:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9f6dfe43c8a55b833ae16486bcafe29b543461f9'/>
<id>urn:sha1:9f6dfe43c8a55b833ae16486bcafe29b543461f9</id>
<content type='text'>
The string_list_split_in_place() function was updated by 52acddf3
(string-list: multi-delimiter `string_list_split_in_place()`,
2023-04-24) to take more than one delimiter characters, hoping that
we can later use it to replace our uses of strtok().  We however did
not make a matching change to the string_list_split() function,
which is very similar.

Before giving both functions more features in future commits, allow
string_list_split() to also take more than one delimiter characters
to make them closer to each other.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>u-string-list: move "remove duplicates" test to "u-string-list.c"</title>
<updated>2025-07-07T15:07:47Z</updated>
<author>
<name>shejialuo</name>
<email>shejialuo@gmail.com</email>
</author>
<published>2025-06-29T04:28:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6e5b26c3ff639211147ccb2b1ca681c768b8db11'/>
<id>urn:sha1:6e5b26c3ff639211147ccb2b1ca681c768b8db11</id>
<content type='text'>
We use "test-tool string-list remove_duplicates" to test the
"string_list_remove_duplicates" function. As we have introduced the unit
test, we'd better remove the logic from shell script to C program to
improve test speed and readability.

As all the tests in shell script are removed, let's just delete the
"t0063-string-list.sh" and update the "meson.build" file to align with
this change.

Also we could simply remove "DISABLE_SIGN_COMPARE_WARNINGS" due to we
have already deleted related code.

Unfortunately, we cannot totally remove "test-string-list.c" due to that
we would test the performance of sorting about string list by executing
"test-tool string-list sort" in "p0071-sort.sh".

Signed-off-by: shejialuo &lt;shejialuo@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>u-string-list: move "filter string" test to "u-string-list.c"</title>
<updated>2025-07-07T15:07:46Z</updated>
<author>
<name>shejialuo</name>
<email>shejialuo@gmail.com</email>
</author>
<published>2025-06-29T04:28:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7e7ce7826534142c069758c13b2d308e901138c0'/>
<id>urn:sha1:7e7ce7826534142c069758c13b2d308e901138c0</id>
<content type='text'>
We use "test-tool string-list filter" to test the "filter_string_list"
function. As we have introduced the unit test, we'd better remove the
logic from shell script to C program to improve test speed and
readability.

Signed-off-by: shejialuo &lt;shejialuo@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>u-string-list: move "test_split_in_place" to "u-string-list.c"</title>
<updated>2025-07-07T15:07:46Z</updated>
<author>
<name>shejialuo</name>
<email>shejialuo@gmail.com</email>
</author>
<published>2025-06-29T04:28:23Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=62c514a9efd2206e081509ca3abc9cd5645eff0b'/>
<id>urn:sha1:62c514a9efd2206e081509ca3abc9cd5645eff0b</id>
<content type='text'>
We use "test-tool string-list split_in_place" to test the
"string_list_split_in_place" function. As we have introduced the unit
test, we'd better remove the logic from shell script to C program to
improve test speed and readability.

Signed-off-by: shejialuo &lt;shejialuo@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>u-string-list: move "test_split" into "u-string-list.c"</title>
<updated>2025-07-07T15:07:46Z</updated>
<author>
<name>shejialuo</name>
<email>shejialuo@gmail.com</email>
</author>
<published>2025-06-29T04:28:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=07d90fda58c79af661016137cbbafab169eeb329'/>
<id>urn:sha1:07d90fda58c79af661016137cbbafab169eeb329</id>
<content type='text'>
We rely on "test-tool string-list" command to test the functionality of
the "string-list". However, as we have introduced clar test framework,
we'd better move the shell script into C program to improve speed and
readability.

Create a new file "u-string-list.c" under "t/unit-tests", then update
the Makefile and "meson.build" to build the file. And let's first move
"test_split" into unit test and gradually convert the shell script into
C program.

In order to create `string_list` easily by simply specifying strings in
the function call, create "t_vcreate_string_list_dup" function to do
this.

Then port the shell script tests to C program and remove unused
"test-tool" code and tests.

Signed-off-by: shejialuo &lt;shejialuo@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
