{"thread":{"id":"52583","subject":"[PATCH 0/1] string-list: note in docs that callers can specify sorting function","startedAt":"2020-01-07T15:07:36Z","lastAt":"2020-01-07T15:07:36Z","messageCount":2,"participants":["Elijah Newren via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"389381","messageId":"pull.689.git.git.1578409650.gitgitgadget@gmail.com","threadId":"52583","inReplyTo":null,"subject":"[PATCH 0/1] string-list: note in docs that callers can specify sorting function","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-01-07T15:07:29Z","receivedAt":"2020-01-07T15:07:36Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Simple change to the string-list docs to reflect the fact that string-list\nnow has a cmp member field these days that can be set to something other\nthan strcmp().\n\nElijah Newren (1):\n  string-list: note in docs that callers can specify sorting function\n\n string-list.h | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\n\nbase-commit: 8679ef24ed64018bb62170c43ce73e0261c0600a\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-689%2Fnewren%2Fstring-list-update-docs-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-689/newren/string-list-update-docs-v1\nPull-Request: https://github.com/git/git/pull/689\n-- \ngitgitgadget\n"},{"id":"389382","messageId":"2e003cfc0a6512861c5826a79e54ebc2ebf3eafb.1578409650.git.gitgitgadget@gmail.com","threadId":"52583","inReplyTo":"pull.689.git.git.1578409650.gitgitgadget@gmail.com","subject":"[PATCH 1/1] string-list: note in docs that callers can specify sorting function","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-01-07T15:07:30Z","receivedAt":"2020-01-07T15:07:36Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"From: Elijah Newren <newren@gmail.com>\n\nIn commit 1959bf6430 (string_list API: document what \"sorted\" means,\n2012-09-17), Documentation/technical/api-string-list.txt was updated to\nspecify that strcmp() was used for sorting.  In commit 8dd5afc926\n(string-list: allow case-insensitive string list, 2013-01-07), a cmp\nmember was added to struct string_list to allow callers to specify an\nalternative comparison function, but api-string-list.txt was not\nupdated.  In commit 4f665f2cf3 (string-list.h: move documentation from\nDocumentation/api/ into header, 2017-09-26), the now out-dated\napi-string-list.txt documentation was moved into string-list.h.  Update\nthe docs to reflect the configurability of sorting.\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n string-list.h | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/string-list.h b/string-list.h\nindex 7bb0ad07e6..6c5d274126 100644\n--- a/string-list.h\n+++ b/string-list.h\n@@ -4,7 +4,8 @@\n /**\n  * The string_list API offers a data structure and functions to handle\n  * sorted and unsorted arrays of strings.  A \"sorted\" list is one whose\n- * entries are sorted by string value in `strcmp()` order.\n+ * entries are sorted by string value in the order specified by the `cmp`\n+ * member (`strcmp()` by default).\n  *\n  * The caller:\n  *\n@@ -209,7 +210,8 @@ struct string_list_item *string_list_append(struct string_list *list, const char\n struct string_list_item *string_list_append_nodup(struct string_list *list, char *string);\n \n /**\n- * Sort the list's entries by string value in `strcmp()` order.\n+ * Sort the list's entries by string value in order specified by list->cmp\n+ * (strcmp() if list->cmp is NULL).\n  */\n void string_list_sort(struct string_list *list);\n \n-- \ngitgitgadget\n"}]}