Skip to content

Commit

Permalink
string_list API: document what "sorted" means
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Sep 18, 2012
1 parent 6511987 commit 1959bf6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Documentation/technical/api-string-list.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
string-list API
===============

The string_list API offers a data structure and functions to handle sorted
and unsorted string lists.
The string_list API offers a data structure and functions to handle
sorted and unsorted string lists. A "sorted" list is one whose
entries are sorted by string value in `strcmp()` order.

The 'string_list' struct used to be called 'path_list', but was renamed
because it is not specific to paths.
Expand Down Expand Up @@ -143,7 +144,7 @@ write `string_list_insert(...)->util = ...;`.

`sort_string_list`::

Make an unsorted list sorted.
Sort the list's entries by string value in `strcmp()` order.

`unsorted_string_list_has_string`::

Expand Down

0 comments on commit 1959bf6

Please sign in to comment.