string_list API: document what "sorted" means
The recent work on using string_list to represent the list of refs that matched with the refs on the other side during fetch heavily depends on the sort order by string_list's implementation, and changing string_list will break it. Document that it uses strcmp() order, at least for now. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Sep 17, 2012 at 17:21 UTC
1959bf6430fda685c46241f220f521a01f9469b7
1 file changed
+4
-3
Documentation/technical/api-string-list.txt
+4
-3
@@ -1,8 +1,9 @@
1
string-list API
2
===============
3
4
-The string_list API offers a data structure and functions to handle sorted
5
-and unsorted string lists.
4
+The string_list API offers a data structure and functions to handle
5
+sorted and unsorted string lists. A "sorted" list is one whose
6
+entries are sorted by string value in `strcmp()` order.
7
8
The 'string_list' struct used to be called 'path_list', but was renamed
9
because it is not specific to paths.
@@ -143,7 +144,7 @@ write `string_list_insert(...)->util = ...;`.
144
145
`sort_string_list`::
146
146
- Make an unsorted list sorted.
147
+ Sort the list's entries by string value in `strcmp()` order.
148
149
`unsorted_string_list_has_string`::
150