{"thread":{"id":"14570","subject":"[PATCH for master] Rename path_list to string_list","startedAt":"2008-07-21T18:03:49Z","lastAt":"2008-07-22T11:09:47Z","messageCount":5,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"84208","messageId":"alpine.DEB.1.00.0807211858330.8986@racer","threadId":"14570","inReplyTo":null,"subject":"[PATCH for master] Rename path_list to string_list","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-21T18:03:49Z","receivedAt":"2008-07-21T18:03:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe name path_list was correct for the first usage of that data structure,\nbut it really is a general-purpose string list.\n\n$ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list)\n$ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list)\n$ git mv path-list.h string-list.h\n$ git mv path-list.c string-list.c\n$ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path)\n$ perl -i -pe 's/path/string/g' string-list.[ch]\n$ git mv Documentation/technical/api-path-list.txt \\\n\tDocumentation/technical/api-string-list.txt\n$ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths)\n\n... and then fix all users of string-list to access the member \"string\"\ninstead of \"path\".\n\nDocumentation/technical/api-string-list.txt needed some rewrapping, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tSince master and next are not far apart currently...\n\n\tWill reply with the interdiff between the tree after said commands \n\tand the tree with this patch, i.e. the non-automatic replacements.\n\n Documentation/CodingGuidelines              |    2 +-\n Documentation/technical/api-path-list.txt   |  126 -------------------------\n Documentation/technical/api-string-list.txt |  128 +++++++++++++++++++++++++\n Makefile                                    |    4 +-\n builtin-apply.c                             |   16 ++--\n builtin-blame.c                             |   10 +-\n builtin-commit.c                            |   20 ++--\n builtin-fast-export.c                       |   14 ++--\n builtin-fetch.c                             |   20 ++--\n builtin-mailsplit.c                         |   12 +-\n builtin-merge-recursive.c                   |   96 ++++++++++----------\n builtin-mv.c                                |   39 ++++----\n builtin-remote.c                            |  124 ++++++++++++------------\n builtin-rerere.c                            |   20 ++--\n builtin-shortlog.c                          |   42 ++++----\n builtin-show-ref.c                          |   10 +-\n diff-no-index.c                             |   22 ++--\n mailmap.c                                   |   12 +-\n mailmap.h                                   |    4 +-\n path-list.c                                 |  134 ---------------------------\n path-list.h                                 |   28 ------\n pretty.c                                    |    4 +-\n reflog-walk.c                               |   10 +-\n rerere.c                                    |   40 ++++----\n rerere.h                                    |    4 +-\n shortlog.h                                  |    6 +-\n string-list.c                               |  134 +++++++++++++++++++++++++++\n string-list.h                               |   28 ++++++\n 28 files changed, 556 insertions(+), 553 deletions(-)\n delete mode 100644 Documentation/technical/api-path-list.txt\n create mode 100644 Documentation/technical/api-string-list.txt\n delete mode 100644 path-list.c\n delete mode 100644 path-list.h\n create mode 100644 string-list.c\n create mode 100644 string-list.h\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex d2a0a76..f628c1f 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -105,7 +105,7 @@ For C programs:\n \n  - Use the API.  No, really.  We have a strbuf (variable length\n    string), several arrays with the ALLOC_GROW() macro, a\n-   path_list for sorted string lists, a hash map (mapping struct\n+   string_list for sorted string lists, a hash map (mapping struct\n    objects) named \"struct decorate\", amongst other things.\n \n  - When you come up with an API, document it.\ndiff --git a/Documentation/technical/api-path-list.txt b/Documentation/technical/api-path-list.txt\ndeleted file mode 100644\nindex 9dbedd0..0000000\n--- a/Documentation/technical/api-path-list.txt\n+++ /dev/null\n@@ -1,126 +0,0 @@\n-path-list API\n-=============\n-\n-The path_list API offers a data structure and functions to handle sorted\n-and unsorted string lists.\n-\n-The name is a bit misleading, a path_list may store not only paths but\n-strings in general.\n-\n-The caller:\n-\n-. Allocates and clears a `struct path_list` variable.\n-\n-. Initializes the members. You might want to set the flag `strdup_paths`\n-  if the strings should be strdup()ed. For example, this is necessary\n-  when you add something like git_path(\"...\"), since that function returns\n-  a static buffer that will change with the next call to git_path().\n-+\n-If you need something advanced, you can manually malloc() the `items`\n-member (you need this if you add things later) and you should set the\n-`nr` and `alloc` members in that case, too.\n-\n-. Adds new items to the list, using `path_list_append` or `path_list_insert`.\n-\n-. Can check if a string is in the list using `path_list_has_path` or\n-  `unsorted_path_list_has_path` and get it from the list using\n-  `path_list_lookup` for sorted lists.\n-\n-. Can sort an unsorted list using `sort_path_list`.\n-\n-. Finally it should free the list using `path_list_clear`.\n-\n-Example:\n-\n-----\n-struct path_list list;\n-int i;\n-\n-memset(&list, 0, sizeof(struct path_list));\n-path_list_append(\"foo\", &list);\n-path_list_append(\"bar\", &list);\n-for (i = 0; i < list.nr; i++)\n-\tprintf(\"%s\\n\", list.items[i].path)\n-----\n-\n-NOTE: It is more efficient to build an unsorted list and sort it\n-afterwards, instead of building a sorted list (`O(n log n)` instead of\n-`O(n^2)`).\n-+\n-However, if you use the list to check if a certain string was added\n-already, you should not do that (using unsorted_path_list_has_path()),\n-because the complexity would be quadratic again (but with a worse factor).\n-\n-Functions\n----------\n-\n-* General ones (works with sorted and unsorted lists as well)\n-\n-`print_path_list`::\n-\n-\tDump a path_list to stdout, useful mainly for debugging purposes. It\n-\tcan take an optional header argument and it writes out the\n-\tstring-pointer pairs of the path_list, each one in its own line.\n-\n-`path_list_clear`::\n-\n-\tFree a path_list. The `path` pointer of the items will be freed in case\n-\tthe `strdup_paths` member of the path_list is set. The second parameter\n-\tcontrols if the `util` pointer of the items should be freed or not.\n-\n-* Functions for sorted lists only\n-\n-`path_list_has_path`::\n-\n-\tDetermine if the path_list has a given string or not.\n-\n-`path_list_insert`::\n-\n-\tInsert a new element to the path_list. The returned pointer can be handy\n-\tif you want to write something to the `util` pointer of the\n-\tpath_list_item containing the just added string.\n-+\n-Since this function uses xrealloc() (which die()s if it fails) if the\n-list needs to grow, it is safe not to check the pointer. I.e. you may\n-write `path_list_insert(...)->util = ...;`.\n-\n-`path_list_lookup`::\n-\n-\tLook up a given string in the path_list, returning the containing\n-\tpath_list_item. If the string is not found, NULL is returned.\n-\n-* Functions for unsorted lists only\n-\n-`path_list_append`::\n-\n-\tAppend a new string to the end of the path_list.\n-\n-`sort_path_list`::\n-\n-\tMake an unsorted list sorted.\n-\n-`unsorted_path_list_has_path`::\n-\n-\tIt's like `path_list_has_path()` but for unsorted lists.\n-+\n-This function needs to look through all items, as opposed to its\n-counterpart for sorted lists, which performs a binary search.\n-\n-Data structures\n----------------\n-\n-* `struct path_list_item`\n-\n-Represents an item of the list. The `path` member is a pointer to the\n-string, and you may use the `util` member for any purpose, if you want.\n-\n-* `struct path_list`\n-\n-Represents the list itself.\n-\n-. The array of items are available via the `items` member.\n-. The `nr` member contains the number of items stored in the list.\n-. The `alloc` member is used to avoid reallocating at every insertion.\n-  You should not tamper with it.\n-. Setting the `strdup_paths` member to 1 will strdup() the strings\n-  before adding them, see above.\ndiff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt\nnew file mode 100644\nindex 0000000..8557f9a\n--- /dev/null\n+++ b/Documentation/technical/api-string-list.txt\n@@ -0,0 +1,128 @@\n+string-list API\n+===============\n+\n+The string_list API offers a data structure and functions to handle sorted\n+and unsorted string lists.\n+\n+The 'string_list' struct used to be called 'path_list', but was renamed\n+because it is not specific to paths.\n+\n+The caller:\n+\n+. Allocates and clears a `struct string_list` variable.\n+\n+. Initializes the members. You might want to set the flag `strdup_strings`\n+  if the strings should be strdup()ed. For example, this is necessary\n+  when you add something like git_path(\"...\"), since that function returns\n+  a static buffer that will change with the next call to git_path().\n++\n+If you need something advanced, you can manually malloc() the `items`\n+member (you need this if you add things later) and you should set the\n+`nr` and `alloc` members in that case, too.\n+\n+. Adds new items to the list, using `string_list_append` or\n+  `string_list_insert`.\n+\n+. Can check if a string is in the list using `string_list_has_string` or\n+  `unsorted_string_list_has_string` and get it from the list using\n+  `string_list_lookup` for sorted lists.\n+\n+. Can sort an unsorted list using `sort_string_list`.\n+\n+. Finally it should free the list using `string_list_clear`.\n+\n+Example:\n+\n+----\n+struct string_list list;\n+int i;\n+\n+memset(&list, 0, sizeof(struct string_list));\n+string_list_append(\"foo\", &list);\n+string_list_append(\"bar\", &list);\n+for (i = 0; i < list.nr; i++)\n+\tprintf(\"%s\\n\", list.items[i].path)\n+----\n+\n+NOTE: It is more efficient to build an unsorted list and sort it\n+afterwards, instead of building a sorted list (`O(n log n)` instead of\n+`O(n^2)`).\n++\n+However, if you use the list to check if a certain string was added\n+already, you should not do that (using unsorted_string_list_has_string()),\n+because the complexity would be quadratic again (but with a worse factor).\n+\n+Functions\n+---------\n+\n+* General ones (works with sorted and unsorted lists as well)\n+\n+`print_string_list`::\n+\n+\tDump a string_list to stdout, useful mainly for debugging purposes. It\n+\tcan take an optional header argument and it writes out the\n+\tstring-pointer pairs of the string_list, each one in its own line.\n+\n+`string_list_clear`::\n+\n+\tFree a string_list. The `path` pointer of the items will be freed in\n+\tcase the `strdup_strings` member of the string_list is set. The second\n+\tparameter controls if the `util` pointer of the items should be freed\n+\tor not.\n+\n+* Functions for sorted lists only\n+\n+`string_list_has_string`::\n+\n+\tDetermine if the string_list has a given string or not.\n+\n+`string_list_insert`::\n+\n+\tInsert a new element to the string_list. The returned pointer can be\n+\thandy if you want to write something to the `util` pointer of the\n+\tstring_list_item containing the just added string.\n++\n+Since this function uses xrealloc() (which die()s if it fails) if the\n+list needs to grow, it is safe not to check the pointer. I.e. you may\n+write `string_list_insert(...)->util = ...;`.\n+\n+`string_list_lookup`::\n+\n+\tLook up a given string in the string_list, returning the containing\n+\tstring_list_item. If the string is not found, NULL is returned.\n+\n+* Functions for unsorted lists only\n+\n+`string_list_append`::\n+\n+\tAppend a new string to the end of the string_list.\n+\n+`sort_string_list`::\n+\n+\tMake an unsorted list sorted.\n+\n+`unsorted_string_list_has_string`::\n+\n+\tIt's like `string_list_has_string()` but for unsorted lists.\n++\n+This function needs to look through all items, as opposed to its\n+counterpart for sorted lists, which performs a binary search.\n+\n+Data structures\n+---------------\n+\n+* `struct string_list_item`\n+\n+Represents an item of the list. The `path` member is a pointer to the\n+string, and you may use the `util` member for any purpose, if you want.\n+\n+* `struct string_list`\n+\n+Represents the list itself.\n+\n+. The array of items are available via the `items` member.\n+. The `nr` member contains the number of items stored in the list.\n+. The `alloc` member is used to avoid reallocating at every insertion.\n+  You should not tamper with it.\n+. Setting the `strdup_strings` member to 1 will strdup() the strings\n+  before adding them, see above.\ndiff --git a/Makefile b/Makefile\nindex 4ce7053..bd2ae64 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -356,7 +356,7 @@ LIB_H += pack-refs.h\n LIB_H += pack-revindex.h\n LIB_H += parse-options.h\n LIB_H += patch-ids.h\n-LIB_H += path-list.h\n+LIB_H += string-list.h\n LIB_H += pkt-line.h\n LIB_H += progress.h\n LIB_H += quote.h\n@@ -437,7 +437,7 @@ LIB_OBJS += pager.o\n LIB_OBJS += parse-options.o\n LIB_OBJS += patch-delta.o\n LIB_OBJS += patch-ids.o\n-LIB_OBJS += path-list.o\n+LIB_OBJS += string-list.o\n LIB_OBJS += path.o\n LIB_OBJS += pkt-line.o\n LIB_OBJS += pretty.o\ndiff --git a/builtin-apply.c b/builtin-apply.c\nindex e15471b..2216a0b 100644\n--- a/builtin-apply.c\n+++ b/builtin-apply.c\n@@ -12,7 +12,7 @@\n #include \"blob.h\"\n #include \"delta.h\"\n #include \"builtin.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n \n /*\n  *  --check turns on checking that the working tree matches the\n@@ -194,7 +194,7 @@ struct image {\n  * the case where more than one patches touch the same file.\n  */\n \n-static struct path_list fn_table;\n+static struct string_list fn_table;\n \n static uint32_t hash_line(const char *cp, size_t len)\n {\n@@ -2250,12 +2250,12 @@ static int read_file_or_gitlink(struct cache_entry *ce, struct strbuf *buf)\n \n static struct patch *in_fn_table(const char *name)\n {\n-\tstruct path_list_item *item;\n+\tstruct string_list_item *item;\n \n \tif (name == NULL)\n \t\treturn NULL;\n \n-\titem = path_list_lookup(name, &fn_table);\n+\titem = string_list_lookup(name, &fn_table);\n \tif (item != NULL)\n \t\treturn (struct patch *)item->util;\n \n@@ -2264,7 +2264,7 @@ static struct patch *in_fn_table(const char *name)\n \n static void add_to_fn_table(struct patch *patch)\n {\n-\tstruct path_list_item *item;\n+\tstruct string_list_item *item;\n \n \t/*\n \t * Always add new_name unless patch is a deletion\n@@ -2272,7 +2272,7 @@ static void add_to_fn_table(struct patch *patch)\n \t * file creations and copies\n \t */\n \tif (patch->new_name != NULL) {\n-\t\titem = path_list_insert(patch->new_name, &fn_table);\n+\t\titem = string_list_insert(patch->new_name, &fn_table);\n \t\titem->util = patch;\n \t}\n \n@@ -2281,7 +2281,7 @@ static void add_to_fn_table(struct patch *patch)\n \t * later chunks shouldn't patch old names\n \t */\n \tif ((patch->new_name == NULL) || (patch->is_rename)) {\n-\t\titem = path_list_insert(patch->old_name, &fn_table);\n+\t\titem = string_list_insert(patch->old_name, &fn_table);\n \t\titem->util = (struct patch *) -1;\n \t}\n }\n@@ -3051,7 +3051,7 @@ static int apply_patch(int fd, const char *filename, int options)\n \tint skipped_patch = 0;\n \n \t/* FIXME - memory leak when using multiple patch files as inputs */\n-\tmemset(&fn_table, 0, sizeof(struct path_list));\n+\tmemset(&fn_table, 0, sizeof(struct string_list));\n \tstrbuf_init(&buf, 0);\n \tpatch_input_file = filename;\n \tread_patch_file(&buf, fd);\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 9bced3b..8b6b09b 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -16,7 +16,7 @@\n #include \"quote.h\"\n #include \"xdiff-interface.h\"\n #include \"cache-tree.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"mailmap.h\"\n #include \"parse-options.h\"\n \n@@ -40,7 +40,7 @@ static int blank_boundary;\n static int incremental;\n static int cmd_is_annotate;\n static int xdl_opts = XDF_NEED_MINIMAL;\n-static struct path_list mailmap;\n+static struct string_list mailmap;\n \n #ifndef DEBUG\n #define DEBUG 0\n@@ -1926,7 +1926,7 @@ static void sanity_check_refcnt(struct scoreboard *sb)\n  * Used for the command line parsing; check if the path exists\n  * in the working tree.\n  */\n-static int has_path_in_work_tree(const char *path)\n+static int has_string_in_work_tree(const char *path)\n {\n \tstruct stat st;\n \treturn !lstat(path, &st);\n@@ -2390,14 +2390,14 @@ parse_done:\n \t\tif (argc < 2)\n \t\t\tusage_with_options(blame_opt_usage, options);\n \t\tpath = add_prefix(prefix, argv[argc - 1]);\n-\t\tif (argc == 3 && !has_path_in_work_tree(path)) { /* (2b) */\n+\t\tif (argc == 3 && !has_string_in_work_tree(path)) { /* (2b) */\n \t\t\tpath = add_prefix(prefix, argv[1]);\n \t\t\targv[1] = argv[2];\n \t\t}\n \t\targv[argc - 1] = \"--\";\n \n \t\tsetup_work_tree();\n-\t\tif (!has_path_in_work_tree(path))\n+\t\tif (!has_string_in_work_tree(path))\n \t\t\tdie(\"cannot stat path %s: %s\", path, strerror(errno));\n \t}\n \ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex ed3fe3f..97e64de 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -21,7 +21,7 @@\n #include \"strbuf.h\"\n #include \"utf8.h\"\n #include \"parse-options.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"rerere.h\"\n #include \"unpack-trees.h\"\n \n@@ -150,7 +150,7 @@ static int commit_index_files(void)\n  * Take a union of paths in the index and the named tree (typically, \"HEAD\"),\n  * and return the paths that match the given pattern in list.\n  */\n-static int list_paths(struct path_list *list, const char *with_tree,\n+static int list_paths(struct string_list *list, const char *with_tree,\n \t\t      const char *prefix, const char **pattern)\n {\n \tint i;\n@@ -169,24 +169,24 @@ static int list_paths(struct path_list *list, const char *with_tree,\n \t\t\tcontinue;\n \t\tif (!pathspec_match(pattern, m, ce->name, 0))\n \t\t\tcontinue;\n-\t\tpath_list_insert(ce->name, list);\n+\t\tstring_list_insert(ce->name, list);\n \t}\n \n \treturn report_path_error(m, pattern, prefix ? strlen(prefix) : 0);\n }\n \n-static void add_remove_files(struct path_list *list)\n+static void add_remove_files(struct string_list *list)\n {\n \tint i;\n \tfor (i = 0; i < list->nr; i++) {\n \t\tstruct stat st;\n-\t\tstruct path_list_item *p = &(list->items[i]);\n+\t\tstruct string_list_item *p = &(list->items[i]);\n \n-\t\tif (!lstat(p->path, &st)) {\n-\t\t\tif (add_to_cache(p->path, &st, 0))\n+\t\tif (!lstat(p->string, &st)) {\n+\t\t\tif (add_to_cache(p->string, &st, 0))\n \t\t\t\tdie(\"updating files failed\");\n \t\t} else\n-\t\t\tremove_file_from_cache(p->path);\n+\t\t\tremove_file_from_cache(p->string);\n \t}\n }\n \n@@ -221,7 +221,7 @@ static void create_base_index(void)\n static char *prepare_index(int argc, const char **argv, const char *prefix)\n {\n \tint fd;\n-\tstruct path_list partial;\n+\tstruct string_list partial;\n \tconst char **pathspec = NULL;\n \n \tif (interactive) {\n@@ -305,7 +305,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)\n \t\tdie(\"cannot do a partial commit during a merge.\");\n \n \tmemset(&partial, 0, sizeof(partial));\n-\tpartial.strdup_paths = 1;\n+\tpartial.strdup_strings = 1;\n \tif (list_paths(&partial, initial_commit ? NULL : \"HEAD\", prefix, pathspec))\n \t\texit(1);\n \ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex a443d59..e508ced 100644\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -13,7 +13,7 @@\n #include \"log-tree.h\"\n #include \"revision.h\"\n #include \"decorate.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"utf8.h\"\n #include \"parse-options.h\"\n \n@@ -309,7 +309,7 @@ static void handle_tag(const char *name, struct tag *tag)\n }\n \n static void get_tags_and_duplicates(struct object_array *pending,\n-\t\t\t\t    struct path_list *extra_refs)\n+\t\t\t\t    struct string_list *extra_refs)\n {\n \tstruct tag *tag;\n \tint i;\n@@ -330,7 +330,7 @@ static void get_tags_and_duplicates(struct object_array *pending,\n \t\tcase OBJ_TAG:\n \t\t\ttag = (struct tag *)e->item;\n \t\t\twhile (tag && tag->object.type == OBJ_TAG) {\n-\t\t\t\tpath_list_insert(full_name, extra_refs)->util = tag;\n+\t\t\t\tstring_list_insert(full_name, extra_refs)->util = tag;\n \t\t\t\ttag = (struct tag *)tag->tagged;\n \t\t\t}\n \t\t\tif (!tag)\n@@ -350,19 +350,19 @@ static void get_tags_and_duplicates(struct object_array *pending,\n \t\t}\n \t\tif (commit->util)\n \t\t\t/* more than one name for the same object */\n-\t\t\tpath_list_insert(full_name, extra_refs)->util = commit;\n+\t\t\tstring_list_insert(full_name, extra_refs)->util = commit;\n \t\telse\n \t\t\tcommit->util = full_name;\n \t}\n }\n \n-static void handle_tags_and_duplicates(struct path_list *extra_refs)\n+static void handle_tags_and_duplicates(struct string_list *extra_refs)\n {\n \tstruct commit *commit;\n \tint i;\n \n \tfor (i = extra_refs->nr - 1; i >= 0; i--) {\n-\t\tconst char *name = extra_refs->items[i].path;\n+\t\tconst char *name = extra_refs->items[i].string;\n \t\tstruct object *object = extra_refs->items[i].util;\n \t\tswitch (object->type) {\n \t\tcase OBJ_TAG:\n@@ -445,7 +445,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n {\n \tstruct rev_info revs;\n \tstruct object_array commits = { 0, 0, NULL };\n-\tstruct path_list extra_refs = { NULL, 0, 0, 0 };\n+\tstruct string_list extra_refs = { NULL, 0, 0, 0 };\n \tstruct commit *commit;\n \tchar *export_filename = NULL, *import_filename = NULL;\n \tstruct option options[] = {\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex 61de50a..7eec4a0 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -5,7 +5,7 @@\n #include \"refs.h\"\n #include \"commit.h\"\n #include \"builtin.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"remote.h\"\n #include \"transport.h\"\n #include \"run-command.h\"\n@@ -465,8 +465,8 @@ static int fetch_refs(struct transport *transport, struct ref *ref_map)\n static int add_existing(const char *refname, const unsigned char *sha1,\n \t\t\tint flag, void *cbdata)\n {\n-\tstruct path_list *list = (struct path_list *)cbdata;\n-\tpath_list_insert(refname, list);\n+\tstruct string_list *list = (struct string_list *)cbdata;\n+\tstring_list_insert(refname, list);\n \treturn 0;\n }\n \n@@ -485,8 +485,8 @@ static void find_non_local_tags(struct transport *transport,\n \t\t\tstruct ref **head,\n \t\t\tstruct ref ***tail)\n {\n-\tstruct path_list existing_refs = { NULL, 0, 0, 0 };\n-\tstruct path_list new_refs = { NULL, 0, 0, 1 };\n+\tstruct string_list existing_refs = { NULL, 0, 0, 0 };\n+\tstruct string_list new_refs = { NULL, 0, 0, 1 };\n \tchar *ref_name;\n \tint ref_name_len;\n \tconst unsigned char *ref_sha1;\n@@ -515,11 +515,11 @@ static void find_non_local_tags(struct transport *transport,\n \t\t\t}\n \t\t}\n \n-\t\tif (!path_list_has_path(&existing_refs, ref_name) &&\n-\t\t    !path_list_has_path(&new_refs, ref_name) &&\n+\t\tif (!string_list_has_string(&existing_refs, ref_name) &&\n+\t\t    !string_list_has_string(&new_refs, ref_name) &&\n \t\t    (has_sha1_file(ref->old_sha1) ||\n \t\t     will_fetch(head, ref->old_sha1))) {\n-\t\t\tpath_list_insert(ref_name, &new_refs);\n+\t\t\tstring_list_insert(ref_name, &new_refs);\n \n \t\t\trm = alloc_ref_from_str(ref_name);\n \t\t\trm->peer_ref = alloc_ref_from_str(ref_name);\n@@ -530,8 +530,8 @@ static void find_non_local_tags(struct transport *transport,\n \t\t}\n \t\tfree(ref_name);\n \t}\n-\tpath_list_clear(&existing_refs, 0);\n-\tpath_list_clear(&new_refs, 0);\n+\tstring_list_clear(&existing_refs, 0);\n+\tstring_list_clear(&new_refs, 0);\n }\n \n static int do_fetch(struct transport *transport,\ndiff --git a/builtin-mailsplit.c b/builtin-mailsplit.c\nindex 13c60c3..71f3b3b 100644\n--- a/builtin-mailsplit.c\n+++ b/builtin-mailsplit.c\n@@ -6,7 +6,7 @@\n  */\n #include \"cache.h\"\n #include \"builtin.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n \n static const char git_mailsplit_usage[] =\n \"git mailsplit [-d<prec>] [-f<n>] [-b] -o<directory> [<mbox>|<Maildir>...]\";\n@@ -115,7 +115,7 @@ static int split_one(FILE *mbox, const char *name, int allow_bare)\n \texit(1);\n }\n \n-static int populate_maildir_list(struct path_list *list, const char *path)\n+static int populate_maildir_list(struct string_list *list, const char *path)\n {\n \tDIR *dir;\n \tstruct dirent *dent;\n@@ -136,7 +136,7 @@ static int populate_maildir_list(struct path_list *list, const char *path)\n \t\t\tif (dent->d_name[0] == '.')\n \t\t\t\tcontinue;\n \t\t\tsnprintf(name, sizeof(name), \"%s/%s\", *sub, dent->d_name);\n-\t\t\tpath_list_insert(name, list);\n+\t\t\tstring_list_insert(name, list);\n \t\t}\n \n \t\tclosedir(dir);\n@@ -152,14 +152,14 @@ static int split_maildir(const char *maildir, const char *dir,\n \tchar name[PATH_MAX];\n \tint ret = -1;\n \tint i;\n-\tstruct path_list list = {NULL, 0, 0, 1};\n+\tstruct string_list list = {NULL, 0, 0, 1};\n \n \tif (populate_maildir_list(&list, maildir) < 0)\n \t\tgoto out;\n \n \tfor (i = 0; i < list.nr; i++) {\n \t\tFILE *f;\n-\t\tsnprintf(file, sizeof(file), \"%s/%s\", maildir, list.items[i].path);\n+\t\tsnprintf(file, sizeof(file), \"%s/%s\", maildir, list.items[i].string);\n \t\tf = fopen(file, \"r\");\n \t\tif (!f) {\n \t\t\terror(\"cannot open mail %s (%s)\", file, strerror(errno));\n@@ -179,7 +179,7 @@ static int split_maildir(const char *maildir, const char *dir,\n \n \tret = skip;\n out:\n-\tpath_list_clear(&list, 1);\n+\tstring_list_clear(&list, 1);\n \treturn ret;\n }\n \ndiff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c\nindex 652a2c3..43e55bf 100644\n--- a/builtin-merge-recursive.c\n+++ b/builtin-merge-recursive.c\n@@ -13,7 +13,7 @@\n #include \"diffcore.h\"\n #include \"tag.h\"\n #include \"unpack-trees.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"xdiff-interface.h\"\n #include \"ll-merge.h\"\n #include \"interpolate.h\"\n@@ -79,8 +79,8 @@ struct stage_data\n \tunsigned processed:1;\n };\n \n-static struct path_list current_file_set = {NULL, 0, 0, 1};\n-static struct path_list current_directory_set = {NULL, 0, 0, 1};\n+static struct string_list current_file_set = {NULL, 0, 0, 1};\n+static struct string_list current_directory_set = {NULL, 0, 0, 1};\n \n static int call_depth = 0;\n static int verbosity = 2;\n@@ -257,9 +257,9 @@ static int save_files_dirs(const unsigned char *sha1,\n \tnewpath[baselen + len] = '\\0';\n \n \tif (S_ISDIR(mode))\n-\t\tpath_list_insert(newpath, &current_directory_set);\n+\t\tstring_list_insert(newpath, &current_directory_set);\n \telse\n-\t\tpath_list_insert(newpath, &current_file_set);\n+\t\tstring_list_insert(newpath, &current_file_set);\n \tfree(newpath);\n \n \treturn READ_TREE_RECURSIVE;\n@@ -280,9 +280,9 @@ static int get_files_dirs(struct tree *tree)\n  */\n static struct stage_data *insert_stage_data(const char *path,\n \t\tstruct tree *o, struct tree *a, struct tree *b,\n-\t\tstruct path_list *entries)\n+\t\tstruct string_list *entries)\n {\n-\tstruct path_list_item *item;\n+\tstruct string_list_item *item;\n \tstruct stage_data *e = xcalloc(1, sizeof(struct stage_data));\n \tget_tree_entry(o->object.sha1, path,\n \t\t\te->stages[1].sha, &e->stages[1].mode);\n@@ -290,7 +290,7 @@ static struct stage_data *insert_stage_data(const char *path,\n \t\t\te->stages[2].sha, &e->stages[2].mode);\n \tget_tree_entry(b->object.sha1, path,\n \t\t\te->stages[3].sha, &e->stages[3].mode);\n-\titem = path_list_insert(path, entries);\n+\titem = string_list_insert(path, entries);\n \titem->util = e;\n \treturn e;\n }\n@@ -299,23 +299,23 @@ static struct stage_data *insert_stage_data(const char *path,\n  * Create a dictionary mapping file names to stage_data objects. The\n  * dictionary contains one entry for every path with a non-zero stage entry.\n  */\n-static struct path_list *get_unmerged(void)\n+static struct string_list *get_unmerged(void)\n {\n-\tstruct path_list *unmerged = xcalloc(1, sizeof(struct path_list));\n+\tstruct string_list *unmerged = xcalloc(1, sizeof(struct string_list));\n \tint i;\n \n-\tunmerged->strdup_paths = 1;\n+\tunmerged->strdup_strings = 1;\n \n \tfor (i = 0; i < active_nr; i++) {\n-\t\tstruct path_list_item *item;\n+\t\tstruct string_list_item *item;\n \t\tstruct stage_data *e;\n \t\tstruct cache_entry *ce = active_cache[i];\n \t\tif (!ce_stage(ce))\n \t\t\tcontinue;\n \n-\t\titem = path_list_lookup(ce->name, unmerged);\n+\t\titem = string_list_lookup(ce->name, unmerged);\n \t\tif (!item) {\n-\t\t\titem = path_list_insert(ce->name, unmerged);\n+\t\t\titem = string_list_insert(ce->name, unmerged);\n \t\t\titem->util = xcalloc(1, sizeof(struct stage_data));\n \t\t}\n \t\te = item->util;\n@@ -340,17 +340,17 @@ struct rename\n  * 'b_tree') to be able to associate the correct cache entries with\n  * the rename information. 'tree' is always equal to either a_tree or b_tree.\n  */\n-static struct path_list *get_renames(struct tree *tree,\n+static struct string_list *get_renames(struct tree *tree,\n \t\t\t\t\tstruct tree *o_tree,\n \t\t\t\t\tstruct tree *a_tree,\n \t\t\t\t\tstruct tree *b_tree,\n-\t\t\t\t\tstruct path_list *entries)\n+\t\t\t\t\tstruct string_list *entries)\n {\n \tint i;\n-\tstruct path_list *renames;\n+\tstruct string_list *renames;\n \tstruct diff_options opts;\n \n-\trenames = xcalloc(1, sizeof(struct path_list));\n+\trenames = xcalloc(1, sizeof(struct string_list));\n \tdiff_setup(&opts);\n \tDIFF_OPT_SET(&opts, RECURSIVE);\n \topts.detect_rename = DIFF_DETECT_RENAME;\n@@ -364,7 +364,7 @@ static struct path_list *get_renames(struct tree *tree,\n \tdiff_tree_sha1(o_tree->object.sha1, tree->object.sha1, \"\", &opts);\n \tdiffcore_std(&opts);\n \tfor (i = 0; i < diff_queued_diff.nr; ++i) {\n-\t\tstruct path_list_item *item;\n+\t\tstruct string_list_item *item;\n \t\tstruct rename *re;\n \t\tstruct diff_filepair *pair = diff_queued_diff.queue[i];\n \t\tif (pair->status != 'R') {\n@@ -374,20 +374,20 @@ static struct path_list *get_renames(struct tree *tree,\n \t\tre = xmalloc(sizeof(*re));\n \t\tre->processed = 0;\n \t\tre->pair = pair;\n-\t\titem = path_list_lookup(re->pair->one->path, entries);\n+\t\titem = string_list_lookup(re->pair->one->path, entries);\n \t\tif (!item)\n \t\t\tre->src_entry = insert_stage_data(re->pair->one->path,\n \t\t\t\t\to_tree, a_tree, b_tree, entries);\n \t\telse\n \t\t\tre->src_entry = item->util;\n \n-\t\titem = path_list_lookup(re->pair->two->path, entries);\n+\t\titem = string_list_lookup(re->pair->two->path, entries);\n \t\tif (!item)\n \t\t\tre->dst_entry = insert_stage_data(re->pair->two->path,\n \t\t\t\t\to_tree, a_tree, b_tree, entries);\n \t\telse\n \t\t\tre->dst_entry = item->util;\n-\t\titem = path_list_insert(pair->one->path, renames);\n+\t\titem = string_list_insert(pair->one->path, renames);\n \t\titem->util = re;\n \t}\n \topts.output_format = DIFF_FORMAT_NO_OUTPUT;\n@@ -464,12 +464,12 @@ static char *unique_path(const char *path, const char *branch)\n \tfor (; *p; ++p)\n \t\tif ('/' == *p)\n \t\t\t*p = '_';\n-\twhile (path_list_has_path(&current_file_set, newpath) ||\n-\t       path_list_has_path(&current_directory_set, newpath) ||\n+\twhile (string_list_has_string(&current_file_set, newpath) ||\n+\t       string_list_has_string(&current_directory_set, newpath) ||\n \t       lstat(newpath, &st) == 0)\n \t\tsprintf(p, \"_%d\", suffix++);\n \n-\tpath_list_insert(newpath, &current_file_set);\n+\tstring_list_insert(newpath, &current_file_set);\n \treturn newpath;\n }\n \n@@ -727,13 +727,13 @@ static void conflict_rename_rename(struct rename *ren1,\n \tconst char *ren2_dst = ren2->pair->two->path;\n \tconst char *dst_name1 = ren1_dst;\n \tconst char *dst_name2 = ren2_dst;\n-\tif (path_list_has_path(&current_directory_set, ren1_dst)) {\n+\tif (string_list_has_string(&current_directory_set, ren1_dst)) {\n \t\tdst_name1 = del[delp++] = unique_path(ren1_dst, branch1);\n \t\toutput(1, \"%s is a directory in %s added as %s instead\",\n \t\t       ren1_dst, branch2, dst_name1);\n \t\tremove_file(0, ren1_dst, 0);\n \t}\n-\tif (path_list_has_path(&current_directory_set, ren2_dst)) {\n+\tif (string_list_has_string(&current_directory_set, ren2_dst)) {\n \t\tdst_name2 = del[delp++] = unique_path(ren2_dst, branch2);\n \t\toutput(1, \"%s is a directory in %s added as %s instead\",\n \t\t       ren2_dst, branch1, dst_name2);\n@@ -783,30 +783,30 @@ static void conflict_rename_rename_2(struct rename *ren1,\n \tfree(new_path1);\n }\n \n-static int process_renames(struct path_list *a_renames,\n-\t\t\t   struct path_list *b_renames,\n+static int process_renames(struct string_list *a_renames,\n+\t\t\t   struct string_list *b_renames,\n \t\t\t   const char *a_branch,\n \t\t\t   const char *b_branch)\n {\n \tint clean_merge = 1, i, j;\n-\tstruct path_list a_by_dst = {NULL, 0, 0, 0}, b_by_dst = {NULL, 0, 0, 0};\n+\tstruct string_list a_by_dst = {NULL, 0, 0, 0}, b_by_dst = {NULL, 0, 0, 0};\n \tconst struct rename *sre;\n \n \tfor (i = 0; i < a_renames->nr; i++) {\n \t\tsre = a_renames->items[i].util;\n-\t\tpath_list_insert(sre->pair->two->path, &a_by_dst)->util\n+\t\tstring_list_insert(sre->pair->two->path, &a_by_dst)->util\n \t\t\t= sre->dst_entry;\n \t}\n \tfor (i = 0; i < b_renames->nr; i++) {\n \t\tsre = b_renames->items[i].util;\n-\t\tpath_list_insert(sre->pair->two->path, &b_by_dst)->util\n+\t\tstring_list_insert(sre->pair->two->path, &b_by_dst)->util\n \t\t\t= sre->dst_entry;\n \t}\n \n \tfor (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) {\n \t\tint compare;\n \t\tchar *src;\n-\t\tstruct path_list *renames1, *renames2, *renames2Dst;\n+\t\tstruct string_list *renames1, *renames2, *renames2Dst;\n \t\tstruct rename *ren1 = NULL, *ren2 = NULL;\n \t\tconst char *branch1, *branch2;\n \t\tconst char *ren1_src, *ren1_dst;\n@@ -818,8 +818,8 @@ static int process_renames(struct path_list *a_renames,\n \t\t\tcompare = -1;\n \t\t\tren1 = a_renames->items[i++].util;\n \t\t} else {\n-\t\t\tcompare = strcmp(a_renames->items[i].path,\n-\t\t\t\t\tb_renames->items[j].path);\n+\t\t\tcompare = strcmp(a_renames->items[i].string,\n+\t\t\t\t\tb_renames->items[j].string);\n \t\t\tif (compare <= 0)\n \t\t\t\tren1 = a_renames->items[i++].util;\n \t\t\tif (compare >= 0)\n@@ -908,7 +908,7 @@ static int process_renames(struct path_list *a_renames,\n \t\t\t}\n \t\t} else {\n \t\t\t/* Renamed in 1, maybe changed in 2 */\n-\t\t\tstruct path_list_item *item;\n+\t\t\tstruct string_list_item *item;\n \t\t\t/* we only use sha1 and mode of these */\n \t\t\tstruct diff_filespec src_other, dst_other;\n \t\t\tint try_merge, stage = a_renames == renames1 ? 3: 2;\n@@ -922,7 +922,7 @@ static int process_renames(struct path_list *a_renames,\n \n \t\t\ttry_merge = 0;\n \n-\t\t\tif (path_list_has_path(&current_directory_set, ren1_dst)) {\n+\t\t\tif (string_list_has_string(&current_directory_set, ren1_dst)) {\n \t\t\t\tclean_merge = 0;\n \t\t\t\toutput(1, \"CONFLICT (rename/directory): Renamed %s->%s in %s \"\n \t\t\t\t       \" directory %s added in %s\",\n@@ -947,7 +947,7 @@ static int process_renames(struct path_list *a_renames,\n \t\t\t\tnew_path = unique_path(ren1_dst, branch2);\n \t\t\t\toutput(1, \"Added as %s instead\", new_path);\n \t\t\t\tupdate_file(0, dst_other.sha1, dst_other.mode, new_path);\n-\t\t\t} else if ((item = path_list_lookup(ren1_dst, renames2Dst))) {\n+\t\t\t} else if ((item = string_list_lookup(ren1_dst, renames2Dst))) {\n \t\t\t\tren2 = item->util;\n \t\t\t\tclean_merge = 0;\n \t\t\t\tren2->processed = 1;\n@@ -1003,8 +1003,8 @@ static int process_renames(struct path_list *a_renames,\n \t\t\t}\n \t\t}\n \t}\n-\tpath_list_clear(&a_by_dst, 0);\n-\tpath_list_clear(&b_by_dst, 0);\n+\tstring_list_clear(&a_by_dst, 0);\n+\tstring_list_clear(&b_by_dst, 0);\n \n \treturn clean_merge;\n }\n@@ -1082,7 +1082,7 @@ static int process_entry(const char *path, struct stage_data *entry,\n \t\t\tsha = b_sha;\n \t\t\tconf = \"directory/file\";\n \t\t}\n-\t\tif (path_list_has_path(&current_directory_set, path)) {\n+\t\tif (string_list_has_string(&current_directory_set, path)) {\n \t\t\tconst char *new_path = unique_path(path, add_branch);\n \t\t\tclean_merge = 0;\n \t\t\toutput(1, \"CONFLICT (%s): There is a directory with name %s in %s. \"\n@@ -1173,10 +1173,10 @@ int merge_trees(struct tree *head,\n \t\t    sha1_to_hex(merge->object.sha1));\n \n \tif (unmerged_cache()) {\n-\t\tstruct path_list *entries, *re_head, *re_merge;\n+\t\tstruct string_list *entries, *re_head, *re_merge;\n \t\tint i;\n-\t\tpath_list_clear(&current_file_set, 1);\n-\t\tpath_list_clear(&current_directory_set, 1);\n+\t\tstring_list_clear(&current_file_set, 1);\n+\t\tstring_list_clear(&current_directory_set, 1);\n \t\tget_files_dirs(head);\n \t\tget_files_dirs(merge);\n \n@@ -1186,16 +1186,16 @@ int merge_trees(struct tree *head,\n \t\tclean = process_renames(re_head, re_merge,\n \t\t\t\tbranch1, branch2);\n \t\tfor (i = 0; i < entries->nr; i++) {\n-\t\t\tconst char *path = entries->items[i].path;\n+\t\t\tconst char *path = entries->items[i].string;\n \t\t\tstruct stage_data *e = entries->items[i].util;\n \t\t\tif (!e->processed\n \t\t\t\t&& !process_entry(path, e, branch1, branch2))\n \t\t\t\tclean = 0;\n \t\t}\n \n-\t\tpath_list_clear(re_merge, 0);\n-\t\tpath_list_clear(re_head, 0);\n-\t\tpath_list_clear(entries, 1);\n+\t\tstring_list_clear(re_merge, 0);\n+\t\tstring_list_clear(re_head, 0);\n+\t\tstring_list_clear(entries, 1);\n \n \t}\n \telse\ndiff --git a/builtin-mv.c b/builtin-mv.c\nindex ba9ceda..736a0b8 100644\n--- a/builtin-mv.c\n+++ b/builtin-mv.c\n@@ -7,7 +7,7 @@\n #include \"builtin.h\"\n #include \"dir.h\"\n #include \"cache-tree.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"parse-options.h\"\n \n static const char * const builtin_mv_usage[] = {\n@@ -36,13 +36,14 @@ static const char **copy_pathspec(const char *prefix, const char **pathspec,\n \treturn get_pathspec(prefix, result);\n }\n \n-static void show_list(const char *label, struct path_list *list)\n+static void show_list(const char *label, struct string_list *list)\n {\n \tif (list->nr > 0) {\n \t\tint i;\n \t\tprintf(\"%s\", label);\n \t\tfor (i = 0; i < list->nr; i++)\n-\t\t\tprintf(\"%s%s\", i > 0 ? \", \" : \"\", list->items[i].path);\n+\t\t\tprintf(\"%s%s\", i > 0 ? \", \" : \"\",\n+\t\t\t\t\tlist->items[i].string);\n \t\tputchar('\\n');\n \t}\n }\n@@ -75,11 +76,11 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \tconst char **source, **destination, **dest_path;\n \tenum update_mode { BOTH = 0, WORKING_DIRECTORY, INDEX } *modes;\n \tstruct stat st;\n-\tstruct path_list overwritten = {NULL, 0, 0, 0};\n-\tstruct path_list src_for_dst = {NULL, 0, 0, 0};\n-\tstruct path_list added = {NULL, 0, 0, 0};\n-\tstruct path_list deleted = {NULL, 0, 0, 0};\n-\tstruct path_list changed = {NULL, 0, 0, 0};\n+\tstruct string_list overwritten = {NULL, 0, 0, 0};\n+\tstruct string_list src_for_dst = {NULL, 0, 0, 0};\n+\tstruct string_list added = {NULL, 0, 0, 0};\n+\tstruct string_list deleted = {NULL, 0, 0, 0};\n+\tstruct string_list changed = {NULL, 0, 0, 0};\n \n \tgit_config(git_default_config, NULL);\n \n@@ -189,16 +190,16 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\t\t\t\t\" will overwrite!\\n\",\n \t\t\t\t\t\t\tbad);\n \t\t\t\t\tbad = NULL;\n-\t\t\t\t\tpath_list_insert(dst, &overwritten);\n+\t\t\t\t\tstring_list_insert(dst, &overwritten);\n \t\t\t\t} else\n \t\t\t\t\tbad = \"Cannot overwrite\";\n \t\t\t}\n \t\t} else if (cache_name_pos(src, length) < 0)\n \t\t\tbad = \"not under version control\";\n-\t\telse if (path_list_has_path(&src_for_dst, dst))\n+\t\telse if (string_list_has_string(&src_for_dst, dst))\n \t\t\tbad = \"multiple sources for the same target\";\n \t\telse\n-\t\t\tpath_list_insert(dst, &src_for_dst);\n+\t\t\tstring_list_insert(dst, &src_for_dst);\n \n \t\tif (bad) {\n \t\t\tif (ignore_errors) {\n@@ -228,15 +229,15 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\tcontinue;\n \n \t\tif (cache_name_pos(src, strlen(src)) >= 0) {\n-\t\t\tpath_list_insert(src, &deleted);\n+\t\t\tstring_list_insert(src, &deleted);\n \n \t\t\t/* destination can be a directory with 1 file inside */\n-\t\t\tif (path_list_has_path(&overwritten, dst))\n-\t\t\t\tpath_list_insert(dst, &changed);\n+\t\t\tif (string_list_has_string(&overwritten, dst))\n+\t\t\t\tstring_list_insert(dst, &changed);\n \t\t\telse\n-\t\t\t\tpath_list_insert(dst, &added);\n+\t\t\t\tstring_list_insert(dst, &added);\n \t\t} else\n-\t\t\tpath_list_insert(dst, &added);\n+\t\t\tstring_list_insert(dst, &added);\n \t}\n \n \tif (show_only) {\n@@ -245,7 +246,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\tshow_list(\"Deleting : \", &deleted);\n \t} else {\n \t\tfor (i = 0; i < changed.nr; i++) {\n-\t\t\tconst char *path = changed.items[i].path;\n+\t\t\tconst char *path = changed.items[i].string;\n \t\t\tint j = cache_name_pos(path, strlen(path));\n \t\t\tstruct cache_entry *ce = active_cache[j];\n \n@@ -255,13 +256,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t}\n \n \t\tfor (i = 0; i < added.nr; i++) {\n-\t\t\tconst char *path = added.items[i].path;\n+\t\t\tconst char *path = added.items[i].string;\n \t\t\tif (add_file_to_cache(path, verbose ? ADD_CACHE_VERBOSE : 0))\n \t\t\t\tdie(\"updating index entries failed\");\n \t\t}\n \n \t\tfor (i = 0; i < deleted.nr; i++)\n-\t\t\tremove_file_from_cache(deleted.items[i].path);\n+\t\t\tremove_file_from_cache(deleted.items[i].string);\n \n \t\tif (active_cache_changed) {\n \t\t\tif (write_cache(newfd, active_cache, active_nr) ||\ndiff --git a/builtin-remote.c b/builtin-remote.c\nindex db12668..54d1c3e 100644\n--- a/builtin-remote.c\n+++ b/builtin-remote.c\n@@ -2,7 +2,7 @@\n #include \"parse-options.h\"\n #include \"transport.h\"\n #include \"remote.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"strbuf.h\"\n #include \"run-command.h\"\n #include \"refs.h\"\n@@ -31,11 +31,11 @@ static inline int postfixcmp(const char *string, const char *postfix)\n \n static int opt_parse_track(const struct option *opt, const char *arg, int not)\n {\n-\tstruct path_list *list = opt->value;\n+\tstruct string_list *list = opt->value;\n \tif (not)\n-\t\tpath_list_clear(list, 0);\n+\t\tstring_list_clear(list, 0);\n \telse\n-\t\tpath_list_append(arg, list);\n+\t\tstring_list_append(arg, list);\n \treturn 0;\n }\n \n@@ -51,7 +51,7 @@ static int fetch_remote(const char *name)\n static int add(int argc, const char **argv)\n {\n \tint fetch = 0, mirror = 0;\n-\tstruct path_list track = { NULL, 0, 0 };\n+\tstruct string_list track = { NULL, 0, 0 };\n \tconst char *master = NULL;\n \tstruct remote *remote;\n \tstruct strbuf buf, buf2;\n@@ -96,18 +96,18 @@ static int add(int argc, const char **argv)\n \tstrbuf_addf(&buf, \"remote.%s.fetch\", name);\n \n \tif (track.nr == 0)\n-\t\tpath_list_append(\"*\", &track);\n+\t\tstring_list_append(\"*\", &track);\n \tfor (i = 0; i < track.nr; i++) {\n-\t\tstruct path_list_item *item = track.items + i;\n+\t\tstruct string_list_item *item = track.items + i;\n \n \t\tstrbuf_reset(&buf2);\n \t\tstrbuf_addch(&buf2, '+');\n \t\tif (mirror)\n \t\t\tstrbuf_addf(&buf2, \"refs/%s:refs/%s\",\n-\t\t\t\t\titem->path, item->path);\n+\t\t\t\t\titem->string, item->string);\n \t\telse\n \t\t\tstrbuf_addf(&buf2, \"refs/heads/%s:refs/remotes/%s/%s\",\n-\t\t\t\t\titem->path, name, item->path);\n+\t\t\t\t\titem->string, name, item->string);\n \t\tif (git_config_set_multivar(buf.buf, buf2.buf, \"^$\", 0))\n \t\t\treturn 1;\n \t}\n@@ -135,17 +135,17 @@ static int add(int argc, const char **argv)\n \n \tstrbuf_release(&buf);\n \tstrbuf_release(&buf2);\n-\tpath_list_clear(&track, 0);\n+\tstring_list_clear(&track, 0);\n \n \treturn 0;\n }\n \n struct branch_info {\n \tchar *remote;\n-\tstruct path_list merge;\n+\tstruct string_list merge;\n };\n \n-static struct path_list branch_list;\n+static struct string_list branch_list;\n \n static const char *abbrev_ref(const char *name, const char *prefix)\n {\n@@ -160,7 +160,7 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n {\n \tif (!prefixcmp(key, \"branch.\")) {\n \t\tchar *name;\n-\t\tstruct path_list_item *item;\n+\t\tstruct string_list_item *item;\n \t\tstruct branch_info *info;\n \t\tenum { REMOTE, MERGE } type;\n \n@@ -174,7 +174,7 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n \t\t} else\n \t\t\treturn 0;\n \n-\t\titem = path_list_insert(name, &branch_list);\n+\t\titem = string_list_insert(name, &branch_list);\n \n \t\tif (!item->util)\n \t\t\titem->util = xcalloc(sizeof(struct branch_info), 1);\n@@ -189,11 +189,11 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n \t\t\twhile (space) {\n \t\t\t\tchar *merge;\n \t\t\t\tmerge = xstrndup(value, space - value);\n-\t\t\t\tpath_list_append(merge, &info->merge);\n+\t\t\t\tstring_list_append(merge, &info->merge);\n \t\t\t\tvalue = abbrev_branch(space + 1);\n \t\t\t\tspace = strchr(value, ' ');\n \t\t\t}\n-\t\t\tpath_list_append(xstrdup(value), &info->merge);\n+\t\t\tstring_list_append(xstrdup(value), &info->merge);\n \t\t}\n \t}\n \treturn 0;\n@@ -204,12 +204,12 @@ static void read_branches(void)\n \tif (branch_list.nr)\n \t\treturn;\n \tgit_config(config_read_branches, NULL);\n-\tsort_path_list(&branch_list);\n+\tsort_string_list(&branch_list);\n }\n \n struct ref_states {\n \tstruct remote *remote;\n-\tstruct path_list new, stale, tracked;\n+\tstruct string_list new, stale, tracked;\n };\n \n static int handle_one_branch(const char *refname,\n@@ -221,16 +221,16 @@ static int handle_one_branch(const char *refname,\n \tmemset(&refspec, 0, sizeof(refspec));\n \trefspec.dst = (char *)refname;\n \tif (!remote_find_tracking(states->remote, &refspec)) {\n-\t\tstruct path_list_item *item;\n+\t\tstruct string_list_item *item;\n \t\tconst char *name = abbrev_branch(refspec.src);\n \t\t/* symbolic refs pointing nowhere were handled already */\n \t\tif ((flags & REF_ISSYMREF) ||\n-\t\t\t\tunsorted_path_list_has_path(&states->tracked,\n+\t\t\t\tunsorted_string_list_has_string(&states->tracked,\n \t\t\t\t\tname) ||\n-\t\t\t\tunsorted_path_list_has_path(&states->new,\n+\t\t\t\tunsorted_string_list_has_string(&states->new,\n \t\t\t\t\tname))\n \t\t\treturn 0;\n-\t\titem = path_list_append(name, &states->stale);\n+\t\titem = string_list_append(name, &states->stale);\n \t\titem->util = xstrdup(refname);\n \t}\n \treturn 0;\n@@ -246,9 +246,9 @@ static int get_ref_states(const struct ref *ref, struct ref_states *states)\n \t\t\tdie(\"Could not get fetch map for refspec %s\",\n \t\t\t\tstates->remote->fetch_refspec[i]);\n \n-\tstates->new.strdup_paths = states->tracked.strdup_paths = 1;\n+\tstates->new.strdup_strings = states->tracked.strdup_strings = 1;\n \tfor (ref = fetch_map; ref; ref = ref->next) {\n-\t\tstruct path_list *target = &states->tracked;\n+\t\tstruct string_list *target = &states->tracked;\n \t\tunsigned char sha1[20];\n \t\tvoid *util = NULL;\n \n@@ -259,12 +259,12 @@ static int get_ref_states(const struct ref *ref, struct ref_states *states)\n \t\t\tif (hashcmp(sha1, ref->new_sha1))\n \t\t\t\tutil = &states;\n \t\t}\n-\t\tpath_list_append(abbrev_branch(ref->name), target)->util = util;\n+\t\tstring_list_append(abbrev_branch(ref->name), target)->util = util;\n \t}\n \tfree_refs(fetch_map);\n \n \tfor_each_ref(handle_one_branch, states);\n-\tsort_path_list(&states->stale);\n+\tsort_string_list(&states->stale);\n \n \treturn 0;\n }\n@@ -296,7 +296,7 @@ static int add_known_remote(struct remote *remote, void *cb_data)\n \n struct branches_for_remote {\n \tstruct remote *remote;\n-\tstruct path_list *branches;\n+\tstruct string_list *branches;\n \tstruct known_remotes *keep;\n };\n \n@@ -305,7 +305,7 @@ static int add_branch_for_removal(const char *refname,\n {\n \tstruct branches_for_remote *branches = cb_data;\n \tstruct refspec refspec;\n-\tstruct path_list_item *item;\n+\tstruct string_list_item *item;\n \tstruct known_remote *kr;\n \n \tmemset(&refspec, 0, sizeof(refspec));\n@@ -325,19 +325,19 @@ static int add_branch_for_removal(const char *refname,\n \tif (flags & REF_ISSYMREF)\n \t\treturn unlink(git_path(refname));\n \n-\titem = path_list_append(refname, branches->branches);\n+\titem = string_list_append(refname, branches->branches);\n \titem->util = xmalloc(20);\n \thashcpy(item->util, sha1);\n \n \treturn 0;\n }\n \n-static int remove_branches(struct path_list *branches)\n+static int remove_branches(struct string_list *branches)\n {\n \tint i, result = 0;\n \tfor (i = 0; i < branches->nr; i++) {\n-\t\tstruct path_list_item *item = branches->items + i;\n-\t\tconst char *refname = item->path;\n+\t\tstruct string_list_item *item = branches->items + i;\n+\t\tconst char *refname = item->string;\n \t\tunsigned char *sha1 = item->util;\n \n \t\tif (delete_ref(refname, sha1))\n@@ -354,7 +354,7 @@ static int rm(int argc, const char **argv)\n \tstruct remote *remote;\n \tstruct strbuf buf;\n \tstruct known_remotes known_remotes = { NULL, NULL };\n-\tstruct path_list branches = { NULL, 0, 0, 1 };\n+\tstruct string_list branches = { NULL, 0, 0, 1 };\n \tstruct branches_for_remote cb_data = { NULL, &branches, &known_remotes };\n \tint i;\n \n@@ -375,14 +375,14 @@ static int rm(int argc, const char **argv)\n \n \tread_branches();\n \tfor (i = 0; i < branch_list.nr; i++) {\n-\t\tstruct path_list_item *item = branch_list.items + i;\n+\t\tstruct string_list_item *item = branch_list.items + i;\n \t\tstruct branch_info *info = item->util;\n \t\tif (info->remote && !strcmp(info->remote, remote->name)) {\n \t\t\tconst char *keys[] = { \"remote\", \"merge\", NULL }, **k;\n \t\t\tfor (k = keys; *k; k++) {\n \t\t\t\tstrbuf_reset(&buf);\n \t\t\t\tstrbuf_addf(&buf, \"branch.%s.%s\",\n-\t\t\t\t\t\titem->path, *k);\n+\t\t\t\t\t\titem->string, *k);\n \t\t\t\tif (git_config_set(buf.buf, NULL)) {\n \t\t\t\t\tstrbuf_release(&buf);\n \t\t\t\t\treturn -1;\n@@ -402,12 +402,12 @@ static int rm(int argc, const char **argv)\n \n \tif (!i)\n \t\ti = remove_branches(&branches);\n-\tpath_list_clear(&branches, 1);\n+\tstring_list_clear(&branches, 1);\n \n \treturn i;\n }\n \n-static void show_list(const char *title, struct path_list *list)\n+static void show_list(const char *title, struct string_list *list)\n {\n \tint i;\n \n@@ -417,7 +417,7 @@ static void show_list(const char *title, struct path_list *list)\n \tprintf(title, list->nr > 1 ? \"es\" : \"\");\n \tprintf(\"\\n    \");\n \tfor (i = 0; i < list->nr; i++)\n-\t\tprintf(\"%s%s\", i ? \" \" : \"\", list->items[i].path);\n+\t\tprintf(\"%s%s\", i ? \" \" : \"\", list->items[i].string);\n \tprintf(\"\\n\");\n }\n \n@@ -455,7 +455,7 @@ static int append_ref_to_tracked_list(const char *refname,\n \tmemset(&refspec, 0, sizeof(refspec));\n \trefspec.dst = (char *)refname;\n \tif (!remote_find_tracking(states->remote, &refspec))\n-\t\tpath_list_append(abbrev_branch(refspec.src), &states->tracked);\n+\t\tstring_list_append(abbrev_branch(refspec.src), &states->tracked);\n \n \treturn 0;\n }\n@@ -487,7 +487,7 @@ static int show(int argc, const char **argv)\n \t\t\t\tstates.remote->url[0] : \"(no URL)\");\n \n \t\tfor (i = 0; i < branch_list.nr; i++) {\n-\t\t\tstruct path_list_item *branch = branch_list.items + i;\n+\t\t\tstruct string_list_item *branch = branch_list.items + i;\n \t\t\tstruct branch_info *info = branch->util;\n \t\t\tint j;\n \n@@ -496,9 +496,9 @@ static int show(int argc, const char **argv)\n \t\t\tprintf(\"  Remote branch%s merged with 'git pull' \"\n \t\t\t\t\"while on branch %s\\n   \",\n \t\t\t\tinfo->merge.nr > 1 ? \"es\" : \"\",\n-\t\t\t\tbranch->path);\n+\t\t\t\tbranch->string);\n \t\t\tfor (j = 0; j < info->merge.nr; j++)\n-\t\t\t\tprintf(\" %s\", info->merge.items[j].path);\n+\t\t\t\tprintf(\" %s\", info->merge.items[j].string);\n \t\t\tprintf(\"\\n\");\n \t\t}\n \n@@ -531,9 +531,9 @@ static int show(int argc, const char **argv)\n \t\t}\n \n \t\t/* NEEDSWORK: free remote */\n-\t\tpath_list_clear(&states.new, 0);\n-\t\tpath_list_clear(&states.stale, 0);\n-\t\tpath_list_clear(&states.tracked, 0);\n+\t\tstring_list_clear(&states.new, 0);\n+\t\tstring_list_clear(&states.stale, 0);\n+\t\tstring_list_clear(&states.tracked, 0);\n \t}\n \n \treturn result;\n@@ -579,9 +579,9 @@ static int prune(int argc, const char **argv)\n \t\t}\n \n \t\t/* NEEDSWORK: free remote */\n-\t\tpath_list_clear(&states.new, 0);\n-\t\tpath_list_clear(&states.stale, 0);\n-\t\tpath_list_clear(&states.tracked, 0);\n+\t\tstring_list_clear(&states.new, 0);\n+\t\tstring_list_clear(&states.stale, 0);\n+\t\tstring_list_clear(&states.tracked, 0);\n \t}\n \n \treturn result;\n@@ -589,15 +589,15 @@ static int prune(int argc, const char **argv)\n \n static int get_one_remote_for_update(struct remote *remote, void *priv)\n {\n-\tstruct path_list *list = priv;\n+\tstruct string_list *list = priv;\n \tif (!remote->skip_default_update)\n-\t\tpath_list_append(xstrdup(remote->name), list);\n+\t\tstring_list_append(xstrdup(remote->name), list);\n \treturn 0;\n }\n \n struct remote_group {\n \tconst char *name;\n-\tstruct path_list *list;\n+\tstruct string_list *list;\n } remote_group;\n \n static int get_remote_group(const char *key, const char *value, void *cb)\n@@ -608,7 +608,7 @@ static int get_remote_group(const char *key, const char *value, void *cb)\n \t\tint space = strcspn(value, \" \\t\\n\");\n \t\twhile (*value) {\n \t\t\tif (space > 1)\n-\t\t\t\tpath_list_append(xstrndup(value, space),\n+\t\t\t\tstring_list_append(xstrndup(value, space),\n \t\t\t\t\t\tremote_group.list);\n \t\t\tvalue += space + (value[space] != '\\0');\n \t\t\tspace = strcspn(value, \" \\t\\n\");\n@@ -621,7 +621,7 @@ static int get_remote_group(const char *key, const char *value, void *cb)\n static int update(int argc, const char **argv)\n {\n \tint i, result = 0;\n-\tstruct path_list list = { NULL, 0, 0, 0 };\n+\tstruct string_list list = { NULL, 0, 0, 0 };\n \tstatic const char *default_argv[] = { NULL, \"default\", NULL };\n \n \tif (argc < 2) {\n@@ -639,20 +639,20 @@ static int update(int argc, const char **argv)\n \t\tresult = for_each_remote(get_one_remote_for_update, &list);\n \n \tfor (i = 0; i < list.nr; i++)\n-\t\tresult |= fetch_remote(list.items[i].path);\n+\t\tresult |= fetch_remote(list.items[i].string);\n \n \t/* all names were strdup()ed or strndup()ed */\n-\tlist.strdup_paths = 1;\n-\tpath_list_clear(&list, 0);\n+\tlist.strdup_strings = 1;\n+\tstring_list_clear(&list, 0);\n \n \treturn result;\n }\n \n static int get_one_entry(struct remote *remote, void *priv)\n {\n-\tstruct path_list *list = priv;\n+\tstruct string_list *list = priv;\n \n-\tpath_list_append(remote->name, list)->util = remote->url_nr ?\n+\tstring_list_append(remote->name, list)->util = remote->url_nr ?\n \t\t(void *)remote->url[0] : NULL;\n \tif (remote->url_nr > 1)\n \t\twarning(\"Remote %s has more than one URL\", remote->name);\n@@ -662,16 +662,16 @@ static int get_one_entry(struct remote *remote, void *priv)\n \n static int show_all(void)\n {\n-\tstruct path_list list = { NULL, 0, 0 };\n+\tstruct string_list list = { NULL, 0, 0 };\n \tint result = for_each_remote(get_one_entry, &list);\n \n \tif (!result) {\n \t\tint i;\n \n-\t\tsort_path_list(&list);\n+\t\tsort_string_list(&list);\n \t\tfor (i = 0; i < list.nr; i++) {\n-\t\t\tstruct path_list_item *item = list.items + i;\n-\t\t\tprintf(\"%s%s%s\\n\", item->path,\n+\t\t\tstruct string_list_item *item = list.items + i;\n+\t\t\tprintf(\"%s%s%s\\n\", item->string,\n \t\t\t\tverbose ? \"\\t\" : \"\",\n \t\t\t\tverbose && item->util ?\n \t\t\t\t\t(const char *)item->util : \"\");\ndiff --git a/builtin-rerere.c b/builtin-rerere.c\nindex 5805805..dd4573f 100644\n--- a/builtin-rerere.c\n+++ b/builtin-rerere.c\n@@ -1,6 +1,6 @@\n #include \"builtin.h\"\n #include \"cache.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"rerere.h\"\n #include \"xdiff/xdiff.h\"\n #include \"xdiff-interface.h\"\n@@ -48,9 +48,9 @@ static int git_rerere_gc_config(const char *var, const char *value, void *cb)\n \treturn 0;\n }\n \n-static void garbage_collect(struct path_list *rr)\n+static void garbage_collect(struct string_list *rr)\n {\n-\tstruct path_list to_remove = { NULL, 0, 0, 1 };\n+\tstruct string_list to_remove = { NULL, 0, 0, 1 };\n \tDIR *dir;\n \tstruct dirent *e;\n \tint i, cutoff;\n@@ -69,11 +69,11 @@ static void garbage_collect(struct path_list *rr)\n \t\tcutoff = (has_resolution(name)\n \t\t\t  ? cutoff_resolve : cutoff_noresolve);\n \t\tif (then < now - cutoff * 86400)\n-\t\t\tpath_list_append(name, &to_remove);\n+\t\t\tstring_list_append(name, &to_remove);\n \t}\n \tfor (i = 0; i < to_remove.nr; i++)\n-\t\tunlink_rr_item(to_remove.items[i].path);\n-\tpath_list_clear(&to_remove, 0);\n+\t\tunlink_rr_item(to_remove.items[i].string);\n+\tstring_list_clear(&to_remove, 0);\n }\n \n static int outf(void *dummy, mmbuffer_t *ptr, int nbuf)\n@@ -111,7 +111,7 @@ static int diff_two(const char *file1, const char *label1,\n \n int cmd_rerere(int argc, const char **argv, const char *prefix)\n {\n-\tstruct path_list merge_rr = { NULL, 0, 0, 1 };\n+\tstruct string_list merge_rr = { NULL, 0, 0, 1 };\n \tint i, fd;\n \n \tif (argc < 2)\n@@ -132,16 +132,16 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)\n \t\tgarbage_collect(&merge_rr);\n \telse if (!strcmp(argv[1], \"status\"))\n \t\tfor (i = 0; i < merge_rr.nr; i++)\n-\t\t\tprintf(\"%s\\n\", merge_rr.items[i].path);\n+\t\t\tprintf(\"%s\\n\", merge_rr.items[i].string);\n \telse if (!strcmp(argv[1], \"diff\"))\n \t\tfor (i = 0; i < merge_rr.nr; i++) {\n-\t\t\tconst char *path = merge_rr.items[i].path;\n+\t\t\tconst char *path = merge_rr.items[i].string;\n \t\t\tconst char *name = (const char *)merge_rr.items[i].util;\n \t\t\tdiff_two(rr_path(name, \"preimage\"), path, path, path);\n \t\t}\n \telse\n \t\tusage(git_rerere_usage);\n \n-\tpath_list_clear(&merge_rr, 1);\n+\tstring_list_clear(&merge_rr, 1);\n \treturn 0;\n }\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex 94c4723..d03f14f 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -2,7 +2,7 @@\n #include \"cache.h\"\n #include \"commit.h\"\n #include \"diff.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"revision.h\"\n #include \"utf8.h\"\n #include \"mailmap.h\"\n@@ -18,8 +18,8 @@ static char const * const shortlog_usage[] = {\n \n static int compare_by_number(const void *a1, const void *a2)\n {\n-\tconst struct path_list_item *i1 = a1, *i2 = a2;\n-\tconst struct path_list *l1 = i1->util, *l2 = i2->util;\n+\tconst struct string_list_item *i1 = a1, *i2 = a2;\n+\tconst struct string_list *l1 = i1->util, *l2 = i2->util;\n \n \tif (l1->nr < l2->nr)\n \t\treturn 1;\n@@ -35,8 +35,8 @@ static void insert_one_record(struct shortlog *log,\n {\n \tconst char *dot3 = log->common_repo_prefix;\n \tchar *buffer, *p;\n-\tstruct path_list_item *item;\n-\tstruct path_list *onelines;\n+\tstruct string_list_item *item;\n+\tstruct string_list *onelines;\n \tchar namebuf[1024];\n \tsize_t len;\n \tconst char *eol;\n@@ -69,9 +69,9 @@ static void insert_one_record(struct shortlog *log,\n \t}\n \n \tbuffer = xstrdup(namebuf);\n-\titem = path_list_insert(buffer, &log->list);\n+\titem = string_list_insert(buffer, &log->list);\n \tif (item->util == NULL)\n-\t\titem->util = xcalloc(1, sizeof(struct path_list));\n+\t\titem->util = xcalloc(1, sizeof(struct string_list));\n \telse\n \t\tfree(buffer);\n \n@@ -109,11 +109,11 @@ static void insert_one_record(struct shortlog *log,\n \t\tonelines->alloc = alloc_nr(onelines->nr);\n \t\tonelines->items = xrealloc(onelines->items,\n \t\t\t\tonelines->alloc\n-\t\t\t\t* sizeof(struct path_list_item));\n+\t\t\t\t* sizeof(struct string_list_item));\n \t}\n \n \tonelines->items[onelines->nr].util = NULL;\n-\tonelines->items[onelines->nr++].path = buffer;\n+\tonelines->items[onelines->nr++].string = buffer;\n }\n \n static void read_from_stdin(struct shortlog *log)\n@@ -231,7 +231,7 @@ void shortlog_init(struct shortlog *log)\n \n \tread_mailmap(&log->mailmap, \".mailmap\", &log->common_repo_prefix);\n \n-\tlog->list.strdup_paths = 1;\n+\tlog->list.strdup_strings = 1;\n \tlog->wrap = DEFAULT_WRAPLEN;\n \tlog->in1 = DEFAULT_INDENT1;\n \tlog->in2 = DEFAULT_INDENT2;\n@@ -299,17 +299,17 @@ void shortlog_output(struct shortlog *log)\n {\n \tint i, j;\n \tif (log->sort_by_number)\n-\t\tqsort(log->list.items, log->list.nr, sizeof(struct path_list_item),\n+\t\tqsort(log->list.items, log->list.nr, sizeof(struct string_list_item),\n \t\t\tcompare_by_number);\n \tfor (i = 0; i < log->list.nr; i++) {\n-\t\tstruct path_list *onelines = log->list.items[i].util;\n+\t\tstruct string_list *onelines = log->list.items[i].util;\n \n \t\tif (log->summary) {\n-\t\t\tprintf(\"%6d\\t%s\\n\", onelines->nr, log->list.items[i].path);\n+\t\t\tprintf(\"%6d\\t%s\\n\", onelines->nr, log->list.items[i].string);\n \t\t} else {\n-\t\t\tprintf(\"%s (%d):\\n\", log->list.items[i].path, onelines->nr);\n+\t\t\tprintf(\"%s (%d):\\n\", log->list.items[i].string, onelines->nr);\n \t\t\tfor (j = onelines->nr - 1; j >= 0; j--) {\n-\t\t\t\tconst char *msg = onelines->items[j].path;\n+\t\t\t\tconst char *msg = onelines->items[j].string;\n \n \t\t\t\tif (log->wrap_lines) {\n \t\t\t\t\tint col = print_wrapped_text(msg, log->in1, log->in2, log->wrap);\n@@ -322,14 +322,14 @@ void shortlog_output(struct shortlog *log)\n \t\t\tputchar('\\n');\n \t\t}\n \n-\t\tonelines->strdup_paths = 1;\n-\t\tpath_list_clear(onelines, 1);\n+\t\tonelines->strdup_strings = 1;\n+\t\tstring_list_clear(onelines, 1);\n \t\tfree(onelines);\n \t\tlog->list.items[i].util = NULL;\n \t}\n \n-\tlog->list.strdup_paths = 1;\n-\tpath_list_clear(&log->list, 1);\n-\tlog->mailmap.strdup_paths = 1;\n-\tpath_list_clear(&log->mailmap, 1);\n+\tlog->list.strdup_strings = 1;\n+\tstring_list_clear(&log->list, 1);\n+\tlog->mailmap.strdup_strings = 1;\n+\tstring_list_clear(&log->mailmap, 1);\n }\ndiff --git a/builtin-show-ref.c b/builtin-show-ref.c\nindex a323633..add1600 100644\n--- a/builtin-show-ref.c\n+++ b/builtin-show-ref.c\n@@ -3,7 +3,7 @@\n #include \"refs.h\"\n #include \"object.h\"\n #include \"tag.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n \n static const char show_ref_usage[] = \"git show-ref [-q|--quiet] [--verify] [-h|--head] [-d|--dereference] [-s|--hash[=<length>]] [--abbrev[=<length>]] [--tags] [--heads] [--] [pattern*] < ref-list\";\n \n@@ -98,8 +98,8 @@ match:\n \n static int add_existing(const char *refname, const unsigned char *sha1, int flag, void *cbdata)\n {\n-\tstruct path_list *list = (struct path_list *)cbdata;\n-\tpath_list_insert(refname, list);\n+\tstruct string_list *list = (struct string_list *)cbdata;\n+\tstring_list_insert(refname, list);\n \treturn 0;\n }\n \n@@ -114,7 +114,7 @@ static int add_existing(const char *refname, const unsigned char *sha1, int flag\n  */\n static int exclude_existing(const char *match)\n {\n-\tstatic struct path_list existing_refs = { NULL, 0, 0, 0 };\n+\tstatic struct string_list existing_refs = { NULL, 0, 0, 0 };\n \tchar buf[1024];\n \tint matchlen = match ? strlen(match) : 0;\n \n@@ -143,7 +143,7 @@ static int exclude_existing(const char *match)\n \t\t\tfprintf(stderr, \"warning: ref '%s' ignored\\n\", ref);\n \t\t\tcontinue;\n \t\t}\n-\t\tif (!path_list_has_path(&existing_refs, ref)) {\n+\t\tif (!string_list_has_string(&existing_refs, ref)) {\n \t\t\tprintf(\"%s\\n\", buf);\n \t\t}\n \t}\ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex f6994cf..7d68b7f 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -14,9 +14,9 @@\n #include \"revision.h\"\n #include \"log-tree.h\"\n #include \"builtin.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n \n-static int read_directory(const char *path, struct path_list *list)\n+static int read_directory(const char *path, struct string_list *list)\n {\n \tDIR *dir;\n \tstruct dirent *e;\n@@ -26,7 +26,7 @@ static int read_directory(const char *path, struct path_list *list)\n \n \twhile ((e = readdir(dir)))\n \t\tif (strcmp(\".\", e->d_name) && strcmp(\"..\", e->d_name))\n-\t\t\tpath_list_insert(e->d_name, list);\n+\t\t\tstring_list_insert(e->d_name, list);\n \n \tclosedir(dir);\n \treturn 0;\n@@ -60,13 +60,13 @@ static int queue_diff(struct diff_options *o,\n \n \tif (S_ISDIR(mode1) || S_ISDIR(mode2)) {\n \t\tchar buffer1[PATH_MAX], buffer2[PATH_MAX];\n-\t\tstruct path_list p1 = {NULL, 0, 0, 1}, p2 = {NULL, 0, 0, 1};\n+\t\tstruct string_list p1 = {NULL, 0, 0, 1}, p2 = {NULL, 0, 0, 1};\n \t\tint len1 = 0, len2 = 0, i1, i2, ret = 0;\n \n \t\tif (name1 && read_directory(name1, &p1))\n \t\t\treturn -1;\n \t\tif (name2 && read_directory(name2, &p2)) {\n-\t\t\tpath_list_clear(&p1, 0);\n+\t\t\tstring_list_clear(&p1, 0);\n \t\t\treturn -1;\n \t\t}\n \n@@ -95,14 +95,14 @@ static int queue_diff(struct diff_options *o,\n \t\t\telse if (i2 == p2.nr)\n \t\t\t\tcomp = -1;\n \t\t\telse\n-\t\t\t\tcomp = strcmp(p1.items[i1].path,\n-\t\t\t\t\tp2.items[i2].path);\n+\t\t\t\tcomp = strcmp(p1.items[i1].string,\n+\t\t\t\t\tp2.items[i2].string);\n \n \t\t\tif (comp > 0)\n \t\t\t\tn1 = NULL;\n \t\t\telse {\n \t\t\t\tn1 = buffer1;\n-\t\t\t\tstrncpy(buffer1 + len1, p1.items[i1++].path,\n+\t\t\t\tstrncpy(buffer1 + len1, p1.items[i1++].string,\n \t\t\t\t\t\tPATH_MAX - len1);\n \t\t\t}\n \n@@ -110,14 +110,14 @@ static int queue_diff(struct diff_options *o,\n \t\t\t\tn2 = NULL;\n \t\t\telse {\n \t\t\t\tn2 = buffer2;\n-\t\t\t\tstrncpy(buffer2 + len2, p2.items[i2++].path,\n+\t\t\t\tstrncpy(buffer2 + len2, p2.items[i2++].string,\n \t\t\t\t\t\tPATH_MAX - len2);\n \t\t\t}\n \n \t\t\tret = queue_diff(o, n1, n2);\n \t\t}\n-\t\tpath_list_clear(&p1, 0);\n-\t\tpath_list_clear(&p2, 0);\n+\t\tstring_list_clear(&p1, 0);\n+\t\tstring_list_clear(&p2, 0);\n \n \t\treturn ret;\n \t} else {\ndiff --git a/mailmap.c b/mailmap.c\nindex f017255..88fc6f3 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -1,8 +1,8 @@\n #include \"cache.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"mailmap.h\"\n \n-int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev)\n+int read_mailmap(struct string_list *map, const char *filename, char **repo_abbrev)\n {\n \tchar buffer[1024];\n \tFILE *f = fopen(filename, \"r\");\n@@ -54,16 +54,16 @@ int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev\n \t\tfor (i = 0; i < right_bracket - left_bracket - 1; i++)\n \t\t\temail[i] = tolower(left_bracket[i + 1]);\n \t\temail[right_bracket - left_bracket - 1] = '\\0';\n-\t\tpath_list_insert(email, map)->util = name;\n+\t\tstring_list_insert(email, map)->util = name;\n \t}\n \tfclose(f);\n \treturn 0;\n }\n \n-int map_email(struct path_list *map, const char *email, char *name, int maxlen)\n+int map_email(struct string_list *map, const char *email, char *name, int maxlen)\n {\n \tchar *p;\n-\tstruct path_list_item *item;\n+\tstruct string_list_item *item;\n \tchar buf[1024], *mailbuf;\n \tint i;\n \n@@ -80,7 +80,7 @@ int map_email(struct path_list *map, const char *email, char *name, int maxlen)\n \tfor (i = 0; i < p - email; i++)\n \t\tmailbuf[i] = tolower(email[i]);\n \tmailbuf[i] = 0;\n-\titem = path_list_lookup(mailbuf, map);\n+\titem = string_list_lookup(mailbuf, map);\n \tif (mailbuf != buf)\n \t\tfree(mailbuf);\n \tif (item != NULL) {\ndiff --git a/mailmap.h b/mailmap.h\nindex 3503fd2..6e48f83 100644\n--- a/mailmap.h\n+++ b/mailmap.h\n@@ -1,7 +1,7 @@\n #ifndef MAILMAP_H\n #define MAILMAP_H\n \n-int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev);\n-int map_email(struct path_list *mailmap, const char *email, char *name, int maxlen);\n+int read_mailmap(struct string_list *map, const char *filename, char **repo_abbrev);\n+int map_email(struct string_list *mailmap, const char *email, char *name, int maxlen);\n \n #endif\ndiff --git a/path-list.c b/path-list.c\ndeleted file mode 100644\nindex 92e5cf2..0000000\n--- a/path-list.c\n+++ /dev/null\n@@ -1,134 +0,0 @@\n-#include \"cache.h\"\n-#include \"path-list.h\"\n-\n-/* if there is no exact match, point to the index where the entry could be\n- * inserted */\n-static int get_entry_index(const struct path_list *list, const char *path,\n-\t\tint *exact_match)\n-{\n-\tint left = -1, right = list->nr;\n-\n-\twhile (left + 1 < right) {\n-\t\tint middle = (left + right) / 2;\n-\t\tint compare = strcmp(path, list->items[middle].path);\n-\t\tif (compare < 0)\n-\t\t\tright = middle;\n-\t\telse if (compare > 0)\n-\t\t\tleft = middle;\n-\t\telse {\n-\t\t\t*exact_match = 1;\n-\t\t\treturn middle;\n-\t\t}\n-\t}\n-\n-\t*exact_match = 0;\n-\treturn right;\n-}\n-\n-/* returns -1-index if already exists */\n-static int add_entry(struct path_list *list, const char *path)\n-{\n-\tint exact_match;\n-\tint index = get_entry_index(list, path, &exact_match);\n-\n-\tif (exact_match)\n-\t\treturn -1 - index;\n-\n-\tif (list->nr + 1 >= list->alloc) {\n-\t\tlist->alloc += 32;\n-\t\tlist->items = xrealloc(list->items, list->alloc\n-\t\t\t\t* sizeof(struct path_list_item));\n-\t}\n-\tif (index < list->nr)\n-\t\tmemmove(list->items + index + 1, list->items + index,\n-\t\t\t\t(list->nr - index)\n-\t\t\t\t* sizeof(struct path_list_item));\n-\tlist->items[index].path = list->strdup_paths ?\n-\t\txstrdup(path) : (char *)path;\n-\tlist->items[index].util = NULL;\n-\tlist->nr++;\n-\n-\treturn index;\n-}\n-\n-struct path_list_item *path_list_insert(const char *path, struct path_list *list)\n-{\n-\tint index = add_entry(list, path);\n-\n-\tif (index < 0)\n-\t\tindex = -1 - index;\n-\n-\treturn list->items + index;\n-}\n-\n-int path_list_has_path(const struct path_list *list, const char *path)\n-{\n-\tint exact_match;\n-\tget_entry_index(list, path, &exact_match);\n-\treturn exact_match;\n-}\n-\n-struct path_list_item *path_list_lookup(const char *path, struct path_list *list)\n-{\n-\tint exact_match, i = get_entry_index(list, path, &exact_match);\n-\tif (!exact_match)\n-\t\treturn NULL;\n-\treturn list->items + i;\n-}\n-\n-void path_list_clear(struct path_list *list, int free_util)\n-{\n-\tif (list->items) {\n-\t\tint i;\n-\t\tif (list->strdup_paths) {\n-\t\t\tfor (i = 0; i < list->nr; i++)\n-\t\t\t\tfree(list->items[i].path);\n-\t\t}\n-\t\tif (free_util) {\n-\t\t\tfor (i = 0; i < list->nr; i++)\n-\t\t\t\tfree(list->items[i].util);\n-\t\t}\n-\t\tfree(list->items);\n-\t}\n-\tlist->items = NULL;\n-\tlist->nr = list->alloc = 0;\n-}\n-\n-void print_path_list(const char *text, const struct path_list *p)\n-{\n-\tint i;\n-\tif ( text )\n-\t\tprintf(\"%s\\n\", text);\n-\tfor (i = 0; i < p->nr; i++)\n-\t\tprintf(\"%s:%p\\n\", p->items[i].path, p->items[i].util);\n-}\n-\n-struct path_list_item *path_list_append(const char *path, struct path_list *list)\n-{\n-\tALLOC_GROW(list->items, list->nr + 1, list->alloc);\n-\tlist->items[list->nr].path =\n-\t\tlist->strdup_paths ? xstrdup(path) : (char *)path;\n-\treturn list->items + list->nr++;\n-}\n-\n-static int cmp_items(const void *a, const void *b)\n-{\n-\tconst struct path_list_item *one = a;\n-\tconst struct path_list_item *two = b;\n-\treturn strcmp(one->path, two->path);\n-}\n-\n-void sort_path_list(struct path_list *list)\n-{\n-\tqsort(list->items, list->nr, sizeof(*list->items), cmp_items);\n-}\n-\n-int unsorted_path_list_has_path(struct path_list *list, const char *path)\n-{\n-\tint i;\n-\tfor (i = 0; i < list->nr; i++)\n-\t\tif (!strcmp(path, list->items[i].path))\n-\t\t\treturn 1;\n-\treturn 0;\n-}\n-\ndiff --git a/path-list.h b/path-list.h\ndeleted file mode 100644\nindex ca2cbba..0000000\n--- a/path-list.h\n+++ /dev/null\n@@ -1,28 +0,0 @@\n-#ifndef PATH_LIST_H\n-#define PATH_LIST_H\n-\n-struct path_list_item {\n-\tchar *path;\n-\tvoid *util;\n-};\n-struct path_list\n-{\n-\tstruct path_list_item *items;\n-\tunsigned int nr, alloc;\n-\tunsigned int strdup_paths:1;\n-};\n-\n-void print_path_list(const char *text, const struct path_list *p);\n-void path_list_clear(struct path_list *list, int free_util);\n-\n-/* Use these functions only on sorted lists: */\n-int path_list_has_path(const struct path_list *list, const char *path);\n-struct path_list_item *path_list_insert(const char *path, struct path_list *list);\n-struct path_list_item *path_list_lookup(const char *path, struct path_list *list);\n-\n-/* Use these functions only on unsorted lists: */\n-struct path_list_item *path_list_append(const char *path, struct path_list *list);\n-void sort_path_list(struct path_list *list);\n-int unsorted_path_list_has_path(struct path_list *list, const char *path);\n-\n-#endif /* PATH_LIST_H */\ndiff --git a/pretty.c b/pretty.c\nindex 628a520..33ef34a 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -3,7 +3,7 @@\n #include \"utf8.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"mailmap.h\"\n \n static char *user_format;\n@@ -292,7 +292,7 @@ static char *logmsg_reencode(const struct commit *commit,\n \n static int mailmap_name(struct strbuf *sb, const char *email)\n {\n-\tstatic struct path_list *mail_map;\n+\tstatic struct string_list *mail_map;\n \tchar buffer[1024];\n \n \tif (!mail_map) {\ndiff --git a/reflog-walk.c b/reflog-walk.c\nindex ee1456b..f751fdc 100644\n--- a/reflog-walk.c\n+++ b/reflog-walk.c\n@@ -3,7 +3,7 @@\n #include \"refs.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"reflog-walk.h\"\n \n struct complete_reflogs {\n@@ -127,7 +127,7 @@ struct commit_reflog {\n \n struct reflog_walk_info {\n \tstruct commit_info_lifo reflogs;\n-\tstruct path_list complete_reflogs;\n+\tstruct string_list complete_reflogs;\n \tstruct commit_reflog *last_commit_reflog;\n };\n \n@@ -141,7 +141,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,\n {\n \tunsigned long timestamp = 0;\n \tint recno = -1;\n-\tstruct path_list_item *item;\n+\tstruct string_list_item *item;\n \tstruct complete_reflogs *reflogs;\n \tchar *branch, *at = strchr(name, '@');\n \tstruct commit_reflog *commit_reflog;\n@@ -161,7 +161,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,\n \t} else\n \t\trecno = 0;\n \n-\titem = path_list_lookup(branch, &info->complete_reflogs);\n+\titem = string_list_lookup(branch, &info->complete_reflogs);\n \tif (item)\n \t\treflogs = item->util;\n \telse {\n@@ -189,7 +189,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,\n \t\t}\n \t\tif (!reflogs || reflogs->nr == 0)\n \t\t\treturn -1;\n-\t\tpath_list_insert(branch, &info->complete_reflogs)->util\n+\t\tstring_list_insert(branch, &info->complete_reflogs)->util\n \t\t\t= reflogs;\n \t}\n \ndiff --git a/rerere.c b/rerere.c\nindex 0456aa6..323e493 100644\n--- a/rerere.c\n+++ b/rerere.c\n@@ -1,5 +1,5 @@\n #include \"cache.h\"\n-#include \"path-list.h\"\n+#include \"string-list.h\"\n #include \"rerere.h\"\n #include \"xdiff/xdiff.h\"\n #include \"xdiff-interface.h\"\n@@ -23,7 +23,7 @@ static int has_resolution(const char *name)\n \treturn !stat(rr_path(name, \"postimage\"), &st);\n }\n \n-static void read_rr(struct path_list *rr)\n+static void read_rr(struct string_list *rr)\n {\n \tunsigned char sha1[20];\n \tchar buf[PATH_MAX];\n@@ -43,14 +43,14 @@ static void read_rr(struct path_list *rr)\n \t\t\t; /* do nothing */\n \t\tif (i == sizeof(buf))\n \t\t\tdie(\"filename too long\");\n-\t\tpath_list_insert(buf, rr)->util = name;\n+\t\tstring_list_insert(buf, rr)->util = name;\n \t}\n \tfclose(in);\n }\n \n static struct lock_file write_lock;\n \n-static int write_rr(struct path_list *rr, int out_fd)\n+static int write_rr(struct string_list *rr, int out_fd)\n {\n \tint i;\n \tfor (i = 0; i < rr->nr; i++) {\n@@ -58,7 +58,7 @@ static int write_rr(struct path_list *rr, int out_fd)\n \t\tint length;\n \t\tif (!rr->items[i].util)\n \t\t\tcontinue;\n-\t\tpath = rr->items[i].path;\n+\t\tpath = rr->items[i].string;\n \t\tlength = strlen(path) + 1;\n \t\tif (write_in_full(out_fd, rr->items[i].util, 40) != 40 ||\n \t\t    write_in_full(out_fd, \"\\t\", 1) != 1 ||\n@@ -154,7 +154,7 @@ static int handle_file(const char *path,\n \treturn hunk_no;\n }\n \n-static int find_conflict(struct path_list *conflict)\n+static int find_conflict(struct string_list *conflict)\n {\n \tint i;\n \tif (read_cache() < 0)\n@@ -167,7 +167,7 @@ static int find_conflict(struct path_list *conflict)\n \t\t    ce_same_name(e2, e3) &&\n \t\t    S_ISREG(e2->ce_mode) &&\n \t\t    S_ISREG(e3->ce_mode)) {\n-\t\t\tpath_list_insert((const char *)e2->name, conflict);\n+\t\t\tstring_list_insert((const char *)e2->name, conflict);\n \t\t\ti++; /* skip over both #2 and #3 */\n \t\t}\n \t}\n@@ -208,7 +208,7 @@ static int merge(const char *name, const char *path)\n \n static struct lock_file index_lock;\n \n-static int update_paths(struct path_list *update)\n+static int update_paths(struct string_list *update)\n {\n \tint i;\n \tint fd = hold_locked_index(&index_lock, 0);\n@@ -218,8 +218,8 @@ static int update_paths(struct path_list *update)\n \t\treturn -1;\n \n \tfor (i = 0; i < update->nr; i++) {\n-\t\tstruct path_list_item *item = &update->items[i];\n-\t\tif (add_file_to_cache(item->path, ADD_CACHE_IGNORE_ERRORS))\n+\t\tstruct string_list_item *item = &update->items[i];\n+\t\tif (add_file_to_cache(item->string, ADD_CACHE_IGNORE_ERRORS))\n \t\t\tstatus = -1;\n \t}\n \n@@ -232,10 +232,10 @@ static int update_paths(struct path_list *update)\n \treturn status;\n }\n \n-static int do_plain_rerere(struct path_list *rr, int fd)\n+static int do_plain_rerere(struct string_list *rr, int fd)\n {\n-\tstruct path_list conflict = { NULL, 0, 0, 1 };\n-\tstruct path_list update = { NULL, 0, 0, 1 };\n+\tstruct string_list conflict = { NULL, 0, 0, 1 };\n+\tstruct string_list update = { NULL, 0, 0, 1 };\n \tint i;\n \n \tfind_conflict(&conflict);\n@@ -248,8 +248,8 @@ static int do_plain_rerere(struct path_list *rr, int fd)\n \t */\n \n \tfor (i = 0; i < conflict.nr; i++) {\n-\t\tconst char *path = conflict.items[i].path;\n-\t\tif (!path_list_has_path(rr, path)) {\n+\t\tconst char *path = conflict.items[i].string;\n+\t\tif (!string_list_has_string(rr, path)) {\n \t\t\tunsigned char sha1[20];\n \t\t\tchar *hex;\n \t\t\tint ret;\n@@ -257,7 +257,7 @@ static int do_plain_rerere(struct path_list *rr, int fd)\n \t\t\tif (ret < 1)\n \t\t\t\tcontinue;\n \t\t\thex = xstrdup(sha1_to_hex(sha1));\n-\t\t\tpath_list_insert(path, rr)->util = hex;\n+\t\t\tstring_list_insert(path, rr)->util = hex;\n \t\t\tif (mkdir(git_path(\"rr-cache/%s\", hex), 0755))\n \t\t\t\tcontinue;;\n \t\t\thandle_file(path, NULL, rr_path(hex, \"preimage\"));\n@@ -273,13 +273,13 @@ static int do_plain_rerere(struct path_list *rr, int fd)\n \n \tfor (i = 0; i < rr->nr; i++) {\n \t\tint ret;\n-\t\tconst char *path = rr->items[i].path;\n+\t\tconst char *path = rr->items[i].string;\n \t\tconst char *name = (const char *)rr->items[i].util;\n \n \t\tif (has_resolution(name)) {\n \t\t\tif (!merge(name, path)) {\n \t\t\t\tif (rerere_autoupdate)\n-\t\t\t\t\tpath_list_insert(path, &update);\n+\t\t\t\t\tstring_list_insert(path, &update);\n \t\t\t\tfprintf(stderr,\n \t\t\t\t\t\"%s '%s' using previous resolution.\\n\",\n \t\t\t\t\trerere_autoupdate\n@@ -337,7 +337,7 @@ static int is_rerere_enabled(void)\n \treturn 1;\n }\n \n-int setup_rerere(struct path_list *merge_rr)\n+int setup_rerere(struct string_list *merge_rr)\n {\n \tint fd;\n \n@@ -353,7 +353,7 @@ int setup_rerere(struct path_list *merge_rr)\n \n int rerere(void)\n {\n-\tstruct path_list merge_rr = { NULL, 0, 0, 1 };\n+\tstruct string_list merge_rr = { NULL, 0, 0, 1 };\n \tint fd;\n \n \tfd = setup_rerere(&merge_rr);\ndiff --git a/rerere.h b/rerere.h\nindex 35b0fa8..f9b0386 100644\n--- a/rerere.h\n+++ b/rerere.h\n@@ -1,9 +1,9 @@\n #ifndef RERERE_H\n #define RERERE_H\n \n-#include \"path-list.h\"\n+#include \"string-list.h\"\n \n-extern int setup_rerere(struct path_list *);\n+extern int setup_rerere(struct string_list *);\n extern int rerere(void);\n \n #endif\ndiff --git a/shortlog.h b/shortlog.h\nindex 6608ee8..bc02cc2 100644\n--- a/shortlog.h\n+++ b/shortlog.h\n@@ -1,10 +1,10 @@\n #ifndef SHORTLOG_H\n #define SHORTLOG_H\n \n-#include \"path-list.h\"\n+#include \"string-list.h\"\n \n struct shortlog {\n-\tstruct path_list list;\n+\tstruct string_list list;\n \tint summary;\n \tint wrap_lines;\n \tint sort_by_number;\n@@ -15,7 +15,7 @@ struct shortlog {\n \n \tchar *common_repo_prefix;\n \tint email;\n-\tstruct path_list mailmap;\n+\tstruct string_list mailmap;\n };\n \n void shortlog_init(struct shortlog *log);\ndiff --git a/string-list.c b/string-list.c\nnew file mode 100644\nindex 0000000..ddd83c8\n--- /dev/null\n+++ b/string-list.c\n@@ -0,0 +1,134 @@\n+#include \"cache.h\"\n+#include \"string-list.h\"\n+\n+/* if there is no exact match, point to the index where the entry could be\n+ * inserted */\n+static int get_entry_index(const struct string_list *list, const char *string,\n+\t\tint *exact_match)\n+{\n+\tint left = -1, right = list->nr;\n+\n+\twhile (left + 1 < right) {\n+\t\tint middle = (left + right) / 2;\n+\t\tint compare = strcmp(string, list->items[middle].string);\n+\t\tif (compare < 0)\n+\t\t\tright = middle;\n+\t\telse if (compare > 0)\n+\t\t\tleft = middle;\n+\t\telse {\n+\t\t\t*exact_match = 1;\n+\t\t\treturn middle;\n+\t\t}\n+\t}\n+\n+\t*exact_match = 0;\n+\treturn right;\n+}\n+\n+/* returns -1-index if already exists */\n+static int add_entry(struct string_list *list, const char *string)\n+{\n+\tint exact_match;\n+\tint index = get_entry_index(list, string, &exact_match);\n+\n+\tif (exact_match)\n+\t\treturn -1 - index;\n+\n+\tif (list->nr + 1 >= list->alloc) {\n+\t\tlist->alloc += 32;\n+\t\tlist->items = xrealloc(list->items, list->alloc\n+\t\t\t\t* sizeof(struct string_list_item));\n+\t}\n+\tif (index < list->nr)\n+\t\tmemmove(list->items + index + 1, list->items + index,\n+\t\t\t\t(list->nr - index)\n+\t\t\t\t* sizeof(struct string_list_item));\n+\tlist->items[index].string = list->strdup_strings ?\n+\t\txstrdup(string) : (char *)string;\n+\tlist->items[index].util = NULL;\n+\tlist->nr++;\n+\n+\treturn index;\n+}\n+\n+struct string_list_item *string_list_insert(const char *string, struct string_list *list)\n+{\n+\tint index = add_entry(list, string);\n+\n+\tif (index < 0)\n+\t\tindex = -1 - index;\n+\n+\treturn list->items + index;\n+}\n+\n+int string_list_has_string(const struct string_list *list, const char *string)\n+{\n+\tint exact_match;\n+\tget_entry_index(list, string, &exact_match);\n+\treturn exact_match;\n+}\n+\n+struct string_list_item *string_list_lookup(const char *string, struct string_list *list)\n+{\n+\tint exact_match, i = get_entry_index(list, string, &exact_match);\n+\tif (!exact_match)\n+\t\treturn NULL;\n+\treturn list->items + i;\n+}\n+\n+void string_list_clear(struct string_list *list, int free_util)\n+{\n+\tif (list->items) {\n+\t\tint i;\n+\t\tif (list->strdup_strings) {\n+\t\t\tfor (i = 0; i < list->nr; i++)\n+\t\t\t\tfree(list->items[i].string);\n+\t\t}\n+\t\tif (free_util) {\n+\t\t\tfor (i = 0; i < list->nr; i++)\n+\t\t\t\tfree(list->items[i].util);\n+\t\t}\n+\t\tfree(list->items);\n+\t}\n+\tlist->items = NULL;\n+\tlist->nr = list->alloc = 0;\n+}\n+\n+void print_string_list(const char *text, const struct string_list *p)\n+{\n+\tint i;\n+\tif ( text )\n+\t\tprintf(\"%s\\n\", text);\n+\tfor (i = 0; i < p->nr; i++)\n+\t\tprintf(\"%s:%p\\n\", p->items[i].string, p->items[i].util);\n+}\n+\n+struct string_list_item *string_list_append(const char *string, struct string_list *list)\n+{\n+\tALLOC_GROW(list->items, list->nr + 1, list->alloc);\n+\tlist->items[list->nr].string =\n+\t\tlist->strdup_strings ? xstrdup(string) : (char *)string;\n+\treturn list->items + list->nr++;\n+}\n+\n+static int cmp_items(const void *a, const void *b)\n+{\n+\tconst struct string_list_item *one = a;\n+\tconst struct string_list_item *two = b;\n+\treturn strcmp(one->string, two->string);\n+}\n+\n+void sort_string_list(struct string_list *list)\n+{\n+\tqsort(list->items, list->nr, sizeof(*list->items), cmp_items);\n+}\n+\n+int unsorted_string_list_has_string(struct string_list *list, const char *string)\n+{\n+\tint i;\n+\tfor (i = 0; i < list->nr; i++)\n+\t\tif (!strcmp(string, list->items[i].string))\n+\t\t\treturn 1;\n+\treturn 0;\n+}\n+\ndiff --git a/string-list.h b/string-list.h\nnew file mode 100644\nindex 0000000..4d6a705\n--- /dev/null\n+++ b/string-list.h\n@@ -0,0 +1,28 @@\n+#ifndef PATH_LIST_H\n+#define PATH_LIST_H\n+\n+struct string_list_item {\n+\tchar *string;\n+\tvoid *util;\n+};\n+struct string_list\n+{\n+\tstruct string_list_item *items;\n+\tunsigned int nr, alloc;\n+\tunsigned int strdup_strings:1;\n+};\n+\n+void print_string_list(const char *text, const struct string_list *p);\n+void string_list_clear(struct string_list *list, int free_util);\n+\n+/* Use these functions only on sorted lists: */\n+int string_list_has_string(const struct string_list *list, const char *string);\n+struct string_list_item *string_list_insert(const char *string, struct string_list *list);\n+struct string_list_item *string_list_lookup(const char *string, struct string_list *list);\n+\n+/* Use these functions only on unsorted lists: */\n+struct string_list_item *string_list_append(const char *string, struct string_list *list);\n+void sort_string_list(struct string_list *list);\n+int unsorted_string_list_has_string(struct string_list *list, const char *string);\n+\n+#endif /* PATH_LIST_H */\n-- \n1.6.0.rc0.196.gb5b33\n"},{"id":"84209","messageId":"alpine.DEB.1.00.0807211904090.8986@racer","threadId":"14570","inReplyTo":"alpine.DEB.1.00.0807211858330.8986@racer","subject":"Re: [PATCH for master] Rename path_list to string_list","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-21T18:05:30Z","receivedAt":"2008-07-21T18:05:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 21 Jul 2008, Johannes Schindelin wrote:\n\n> \tWill reply with the interdiff between the tree after said commands \n> \tand the tree with this patch, i.e. the non-automatic replacements.\n\nAnd so I do.\n\nThis looks much nicer than the big patch I just sent out, as it only\ncontains the changes after the semi-automatic replacements with perl.\n\nCiao,\nDscho\n\n Documentation/technical/api-string-list.txt |   20 +++++++++++---------\n builtin-commit.c                            |    6 +++---\n builtin-fast-export.c                       |    2 +-\n builtin-mailsplit.c                         |    2 +-\n builtin-merge-recursive.c                   |    6 +++---\n builtin-mv.c                                |    9 +++++----\n builtin-remote.c                            |   18 +++++++++---------\n builtin-rerere.c                            |    6 +++---\n builtin-shortlog.c                          |    8 ++++----\n diff-no-index.c                             |    8 ++++----\n my-prepare-patch.sh                         |    2 +-\n rerere.c                                    |    8 ++++----\n 12 files changed, 49 insertions(+), 46 deletions(-)\n\ndiff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt\nindex 9d9190d..8557f9a 100644\n--- a/Documentation/technical/api-string-list.txt\n+++ b/Documentation/technical/api-string-list.txt\n@@ -1,11 +1,11 @@\n string-list API\n-=============\n+===============\n \n The string_list API offers a data structure and functions to handle sorted\n and unsorted string lists.\n \n-The name is a bit misleading, a string_list may store not only paths but\n-strings in general.\n+The 'string_list' struct used to be called 'path_list', but was renamed\n+because it is not specific to paths.\n \n The caller:\n \n@@ -20,7 +20,8 @@ If you need something advanced, you can manually malloc() the `items`\n member (you need this if you add things later) and you should set the\n `nr` and `alloc` members in that case, too.\n \n-. Adds new items to the list, using `string_list_append` or `string_list_insert`.\n+. Adds new items to the list, using `string_list_append` or\n+  `string_list_insert`.\n \n . Can check if a string is in the list using `string_list_has_string` or\n   `unsorted_string_list_has_string` and get it from the list using\n@@ -64,9 +65,10 @@ Functions\n \n `string_list_clear`::\n \n-\tFree a string_list. The `path` pointer of the items will be freed in case\n-\tthe `strdup_strings` member of the string_list is set. The second parameter\n-\tcontrols if the `util` pointer of the items should be freed or not.\n+\tFree a string_list. The `path` pointer of the items will be freed in\n+\tcase the `strdup_strings` member of the string_list is set. The second\n+\tparameter controls if the `util` pointer of the items should be freed\n+\tor not.\n \n * Functions for sorted lists only\n \n@@ -76,8 +78,8 @@ Functions\n \n `string_list_insert`::\n \n-\tInsert a new element to the string_list. The returned pointer can be handy\n-\tif you want to write something to the `util` pointer of the\n+\tInsert a new element to the string_list. The returned pointer can be\n+\thandy if you want to write something to the `util` pointer of the\n \tstring_list_item containing the just added string.\n +\n Since this function uses xrealloc() (which die()s if it fails) if the\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 54aa83f..97e64de 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -182,11 +182,11 @@ static void add_remove_files(struct string_list *list)\n \t\tstruct stat st;\n \t\tstruct string_list_item *p = &(list->items[i]);\n \n-\t\tif (!lstat(p->path, &st)) {\n-\t\t\tif (add_to_cache(p->path, &st, 0))\n+\t\tif (!lstat(p->string, &st)) {\n+\t\t\tif (add_to_cache(p->string, &st, 0))\n \t\t\t\tdie(\"updating files failed\");\n \t\t} else\n-\t\t\tremove_file_from_cache(p->path);\n+\t\t\tremove_file_from_cache(p->string);\n \t}\n }\n \ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex 822e039..e508ced 100644\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -362,7 +362,7 @@ static void handle_tags_and_duplicates(struct string_list *extra_refs)\n \tint i;\n \n \tfor (i = extra_refs->nr - 1; i >= 0; i--) {\n-\t\tconst char *name = extra_refs->items[i].path;\n+\t\tconst char *name = extra_refs->items[i].string;\n \t\tstruct object *object = extra_refs->items[i].util;\n \t\tswitch (object->type) {\n \t\tcase OBJ_TAG:\ndiff --git a/builtin-mailsplit.c b/builtin-mailsplit.c\nindex 99b35e0..71f3b3b 100644\n--- a/builtin-mailsplit.c\n+++ b/builtin-mailsplit.c\n@@ -159,7 +159,7 @@ static int split_maildir(const char *maildir, const char *dir,\n \n \tfor (i = 0; i < list.nr; i++) {\n \t\tFILE *f;\n-\t\tsnprintf(file, sizeof(file), \"%s/%s\", maildir, list.items[i].path);\n+\t\tsnprintf(file, sizeof(file), \"%s/%s\", maildir, list.items[i].string);\n \t\tf = fopen(file, \"r\");\n \t\tif (!f) {\n \t\t\terror(\"cannot open mail %s (%s)\", file, strerror(errno));\ndiff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c\nindex e0b6ffe..43e55bf 100644\n--- a/builtin-merge-recursive.c\n+++ b/builtin-merge-recursive.c\n@@ -818,8 +818,8 @@ static int process_renames(struct string_list *a_renames,\n \t\t\tcompare = -1;\n \t\t\tren1 = a_renames->items[i++].util;\n \t\t} else {\n-\t\t\tcompare = strcmp(a_renames->items[i].path,\n-\t\t\t\t\tb_renames->items[j].path);\n+\t\t\tcompare = strcmp(a_renames->items[i].string,\n+\t\t\t\t\tb_renames->items[j].string);\n \t\t\tif (compare <= 0)\n \t\t\t\tren1 = a_renames->items[i++].util;\n \t\t\tif (compare >= 0)\n@@ -1186,7 +1186,7 @@ int merge_trees(struct tree *head,\n \t\tclean = process_renames(re_head, re_merge,\n \t\t\t\tbranch1, branch2);\n \t\tfor (i = 0; i < entries->nr; i++) {\n-\t\t\tconst char *path = entries->items[i].path;\n+\t\t\tconst char *path = entries->items[i].string;\n \t\t\tstruct stage_data *e = entries->items[i].util;\n \t\t\tif (!e->processed\n \t\t\t\t&& !process_entry(path, e, branch1, branch2))\ndiff --git a/builtin-mv.c b/builtin-mv.c\nindex c3038e2..736a0b8 100644\n--- a/builtin-mv.c\n+++ b/builtin-mv.c\n@@ -42,7 +42,8 @@ static void show_list(const char *label, struct string_list *list)\n \t\tint i;\n \t\tprintf(\"%s\", label);\n \t\tfor (i = 0; i < list->nr; i++)\n-\t\t\tprintf(\"%s%s\", i > 0 ? \", \" : \"\", list->items[i].path);\n+\t\t\tprintf(\"%s%s\", i > 0 ? \", \" : \"\",\n+\t\t\t\t\tlist->items[i].string);\n \t\tputchar('\\n');\n \t}\n }\n@@ -245,7 +246,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\tshow_list(\"Deleting : \", &deleted);\n \t} else {\n \t\tfor (i = 0; i < changed.nr; i++) {\n-\t\t\tconst char *path = changed.items[i].path;\n+\t\t\tconst char *path = changed.items[i].string;\n \t\t\tint j = cache_name_pos(path, strlen(path));\n \t\t\tstruct cache_entry *ce = active_cache[j];\n \n@@ -255,13 +256,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t}\n \n \t\tfor (i = 0; i < added.nr; i++) {\n-\t\t\tconst char *path = added.items[i].path;\n+\t\t\tconst char *path = added.items[i].string;\n \t\t\tif (add_file_to_cache(path, verbose ? ADD_CACHE_VERBOSE : 0))\n \t\t\t\tdie(\"updating index entries failed\");\n \t\t}\n \n \t\tfor (i = 0; i < deleted.nr; i++)\n-\t\t\tremove_file_from_cache(deleted.items[i].path);\n+\t\t\tremove_file_from_cache(deleted.items[i].string);\n \n \t\tif (active_cache_changed) {\n \t\t\tif (write_cache(newfd, active_cache, active_nr) ||\ndiff --git a/builtin-remote.c b/builtin-remote.c\nindex 04de9e1..54d1c3e 100644\n--- a/builtin-remote.c\n+++ b/builtin-remote.c\n@@ -104,10 +104,10 @@ static int add(int argc, const char **argv)\n \t\tstrbuf_addch(&buf2, '+');\n \t\tif (mirror)\n \t\t\tstrbuf_addf(&buf2, \"refs/%s:refs/%s\",\n-\t\t\t\t\titem->path, item->path);\n+\t\t\t\t\titem->string, item->string);\n \t\telse\n \t\t\tstrbuf_addf(&buf2, \"refs/heads/%s:refs/remotes/%s/%s\",\n-\t\t\t\t\titem->path, name, item->path);\n+\t\t\t\t\titem->string, name, item->string);\n \t\tif (git_config_set_multivar(buf.buf, buf2.buf, \"^$\", 0))\n \t\t\treturn 1;\n \t}\n@@ -337,7 +337,7 @@ static int remove_branches(struct string_list *branches)\n \tint i, result = 0;\n \tfor (i = 0; i < branches->nr; i++) {\n \t\tstruct string_list_item *item = branches->items + i;\n-\t\tconst char *refname = item->path;\n+\t\tconst char *refname = item->string;\n \t\tunsigned char *sha1 = item->util;\n \n \t\tif (delete_ref(refname, sha1))\n@@ -382,7 +382,7 @@ static int rm(int argc, const char **argv)\n \t\t\tfor (k = keys; *k; k++) {\n \t\t\t\tstrbuf_reset(&buf);\n \t\t\t\tstrbuf_addf(&buf, \"branch.%s.%s\",\n-\t\t\t\t\t\titem->path, *k);\n+\t\t\t\t\t\titem->string, *k);\n \t\t\t\tif (git_config_set(buf.buf, NULL)) {\n \t\t\t\t\tstrbuf_release(&buf);\n \t\t\t\t\treturn -1;\n@@ -417,7 +417,7 @@ static void show_list(const char *title, struct string_list *list)\n \tprintf(title, list->nr > 1 ? \"es\" : \"\");\n \tprintf(\"\\n    \");\n \tfor (i = 0; i < list->nr; i++)\n-\t\tprintf(\"%s%s\", i ? \" \" : \"\", list->items[i].path);\n+\t\tprintf(\"%s%s\", i ? \" \" : \"\", list->items[i].string);\n \tprintf(\"\\n\");\n }\n \n@@ -496,9 +496,9 @@ static int show(int argc, const char **argv)\n \t\t\tprintf(\"  Remote branch%s merged with 'git pull' \"\n \t\t\t\t\"while on branch %s\\n   \",\n \t\t\t\tinfo->merge.nr > 1 ? \"es\" : \"\",\n-\t\t\t\tbranch->path);\n+\t\t\t\tbranch->string);\n \t\t\tfor (j = 0; j < info->merge.nr; j++)\n-\t\t\t\tprintf(\" %s\", info->merge.items[j].path);\n+\t\t\t\tprintf(\" %s\", info->merge.items[j].string);\n \t\t\tprintf(\"\\n\");\n \t\t}\n \n@@ -639,7 +639,7 @@ static int update(int argc, const char **argv)\n \t\tresult = for_each_remote(get_one_remote_for_update, &list);\n \n \tfor (i = 0; i < list.nr; i++)\n-\t\tresult |= fetch_remote(list.items[i].path);\n+\t\tresult |= fetch_remote(list.items[i].string);\n \n \t/* all names were strdup()ed or strndup()ed */\n \tlist.strdup_strings = 1;\n@@ -671,7 +671,7 @@ static int show_all(void)\n \t\tsort_string_list(&list);\n \t\tfor (i = 0; i < list.nr; i++) {\n \t\t\tstruct string_list_item *item = list.items + i;\n-\t\t\tprintf(\"%s%s%s\\n\", item->path,\n+\t\t\tprintf(\"%s%s%s\\n\", item->string,\n \t\t\t\tverbose ? \"\\t\" : \"\",\n \t\t\t\tverbose && item->util ?\n \t\t\t\t\t(const char *)item->util : \"\");\ndiff --git a/builtin-rerere.c b/builtin-rerere.c\nindex 7315d1a..dd4573f 100644\n--- a/builtin-rerere.c\n+++ b/builtin-rerere.c\n@@ -72,7 +72,7 @@ static void garbage_collect(struct string_list *rr)\n \t\t\tstring_list_append(name, &to_remove);\n \t}\n \tfor (i = 0; i < to_remove.nr; i++)\n-\t\tunlink_rr_item(to_remove.items[i].path);\n+\t\tunlink_rr_item(to_remove.items[i].string);\n \tstring_list_clear(&to_remove, 0);\n }\n \n@@ -132,10 +132,10 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)\n \t\tgarbage_collect(&merge_rr);\n \telse if (!strcmp(argv[1], \"status\"))\n \t\tfor (i = 0; i < merge_rr.nr; i++)\n-\t\t\tprintf(\"%s\\n\", merge_rr.items[i].path);\n+\t\t\tprintf(\"%s\\n\", merge_rr.items[i].string);\n \telse if (!strcmp(argv[1], \"diff\"))\n \t\tfor (i = 0; i < merge_rr.nr; i++) {\n-\t\t\tconst char *path = merge_rr.items[i].path;\n+\t\t\tconst char *path = merge_rr.items[i].string;\n \t\t\tconst char *name = (const char *)merge_rr.items[i].util;\n \t\t\tdiff_two(rr_path(name, \"preimage\"), path, path, path);\n \t\t}\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex 4ab66d3..d03f14f 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -113,7 +113,7 @@ static void insert_one_record(struct shortlog *log,\n \t}\n \n \tonelines->items[onelines->nr].util = NULL;\n-\tonelines->items[onelines->nr++].path = buffer;\n+\tonelines->items[onelines->nr++].string = buffer;\n }\n \n static void read_from_stdin(struct shortlog *log)\n@@ -305,11 +305,11 @@ void shortlog_output(struct shortlog *log)\n \t\tstruct string_list *onelines = log->list.items[i].util;\n \n \t\tif (log->summary) {\n-\t\t\tprintf(\"%6d\\t%s\\n\", onelines->nr, log->list.items[i].path);\n+\t\t\tprintf(\"%6d\\t%s\\n\", onelines->nr, log->list.items[i].string);\n \t\t} else {\n-\t\t\tprintf(\"%s (%d):\\n\", log->list.items[i].path, onelines->nr);\n+\t\t\tprintf(\"%s (%d):\\n\", log->list.items[i].string, onelines->nr);\n \t\t\tfor (j = onelines->nr - 1; j >= 0; j--) {\n-\t\t\t\tconst char *msg = onelines->items[j].path;\n+\t\t\t\tconst char *msg = onelines->items[j].string;\n \n \t\t\t\tif (log->wrap_lines) {\n \t\t\t\t\tint col = print_wrapped_text(msg, log->in1, log->in2, log->wrap);\ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex 31e7708..7d68b7f 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -95,14 +95,14 @@ static int queue_diff(struct diff_options *o,\n \t\t\telse if (i2 == p2.nr)\n \t\t\t\tcomp = -1;\n \t\t\telse\n-\t\t\t\tcomp = strcmp(p1.items[i1].path,\n-\t\t\t\t\tp2.items[i2].path);\n+\t\t\t\tcomp = strcmp(p1.items[i1].string,\n+\t\t\t\t\tp2.items[i2].string);\n \n \t\t\tif (comp > 0)\n \t\t\t\tn1 = NULL;\n \t\t\telse {\n \t\t\t\tn1 = buffer1;\n-\t\t\t\tstrncpy(buffer1 + len1, p1.items[i1++].path,\n+\t\t\t\tstrncpy(buffer1 + len1, p1.items[i1++].string,\n \t\t\t\t\t\tPATH_MAX - len1);\n \t\t\t}\n \n@@ -110,7 +110,7 @@ static int queue_diff(struct diff_options *o,\n \t\t\t\tn2 = NULL;\n \t\t\telse {\n \t\t\t\tn2 = buffer2;\n-\t\t\t\tstrncpy(buffer2 + len2, p2.items[i2++].path,\n+\t\t\t\tstrncpy(buffer2 + len2, p2.items[i2++].string,\n \t\t\t\t\t\tPATH_MAX - len2);\n \t\t\t}\n \ndiff --git a/my-prepare-patch.sh b/my-prepare-patch.sh\nindex b565487..46cb7d7 100755\n--- a/my-prepare-patch.sh\n+++ b/my-prepare-patch.sh\n@@ -24,7 +24,7 @@ Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n \n EOF\n \n-git apply --stat < $tmp\n+git-apply --stat < $tmp\n \n echo\n \ndiff --git a/rerere.c b/rerere.c\nindex c659cfb..323e493 100644\n--- a/rerere.c\n+++ b/rerere.c\n@@ -58,7 +58,7 @@ static int write_rr(struct string_list *rr, int out_fd)\n \t\tint length;\n \t\tif (!rr->items[i].util)\n \t\t\tcontinue;\n-\t\tpath = rr->items[i].path;\n+\t\tpath = rr->items[i].string;\n \t\tlength = strlen(path) + 1;\n \t\tif (write_in_full(out_fd, rr->items[i].util, 40) != 40 ||\n \t\t    write_in_full(out_fd, \"\\t\", 1) != 1 ||\n@@ -219,7 +219,7 @@ static int update_paths(struct string_list *update)\n \n \tfor (i = 0; i < update->nr; i++) {\n \t\tstruct string_list_item *item = &update->items[i];\n-\t\tif (add_file_to_cache(item->path, ADD_CACHE_IGNORE_ERRORS))\n+\t\tif (add_file_to_cache(item->string, ADD_CACHE_IGNORE_ERRORS))\n \t\t\tstatus = -1;\n \t}\n \n@@ -248,7 +248,7 @@ static int do_plain_rerere(struct string_list *rr, int fd)\n \t */\n \n \tfor (i = 0; i < conflict.nr; i++) {\n-\t\tconst char *path = conflict.items[i].path;\n+\t\tconst char *path = conflict.items[i].string;\n \t\tif (!string_list_has_string(rr, path)) {\n \t\t\tunsigned char sha1[20];\n \t\t\tchar *hex;\n@@ -273,7 +273,7 @@ static int do_plain_rerere(struct string_list *rr, int fd)\n \n \tfor (i = 0; i < rr->nr; i++) {\n \t\tint ret;\n-\t\tconst char *path = rr->items[i].path;\n+\t\tconst char *path = rr->items[i].string;\n \t\tconst char *name = (const char *)rr->items[i].util;\n \n \t\tif (has_resolution(name)) {\n"},{"id":"84253","messageId":"alpine.DEB.1.00.0807220131590.3407@eeepc-johanness","threadId":"14570","inReplyTo":"alpine.DEB.1.00.0807211904090.8986@racer","subject":"Re: [PATCH for master] Rename path_list to string_list","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-21T23:33:45Z","receivedAt":"2008-07-21T23:33:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 21 Jul 2008, Johannes Schindelin wrote:\n\n>  my-prepare-patch.sh                         |    2 +-\n\nAs was pointed out to me privately, this should not have been part of the \ninterdiff.  It is the script I used to prepare the interdiff, and it \nneeded fixing in order to run without \"git-apply\" in the PATH.  That is \nhow this change slipped in.\n\nPlease just ignore that file,\nDscho\n"},{"id":"84260","messageId":"7v3am2sldy.fsf@gitster.siamese.dyndns.org","threadId":"14570","inReplyTo":"alpine.DEB.1.00.0807211904090.8986@racer","subject":"Re: [PATCH for master] Rename path_list to string_list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-22T02:28:09Z","receivedAt":"2008-07-22T02:28:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> @@ -64,9 +65,10 @@ Functions\n>  \n>  `string_list_clear`::\n>  \n> -\tFree a string_list. The `path` pointer of the items will be freed in case\n> -\tthe `strdup_strings` member of the string_list is set. The second parameter\n> -\tcontrols if the `util` pointer of the items should be freed or not.\n> +\tFree a string_list. The `path` pointer of the items will be freed in\n> +\tcase the `strdup_strings` member of the string_list is set. The second\n> +\tparameter controls if the `util` pointer of the items should be freed\n> +\tor not.\n\nMissed 's/path/string/' here?\n\nEverything else looked fine, thanks.\n"},{"id":"84320","messageId":"alpine.DEB.1.00.0807221308050.3391@eeepc-johanness","threadId":"14570","inReplyTo":"7v3am2sldy.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH for master] Rename path_list to string_list","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-22T11:09:47Z","receivedAt":"2008-07-22T11:09:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 21 Jul 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > @@ -64,9 +65,10 @@ Functions\n> >  \n> >  `string_list_clear`::\n> >  \n> > -\tFree a string_list. The `path` pointer of the items will be freed in case\n> > -\tthe `strdup_strings` member of the string_list is set. The second parameter\n> > -\tcontrols if the `util` pointer of the items should be freed or not.\n> > +\tFree a string_list. The `path` pointer of the items will be freed in\n> > +\tcase the `strdup_strings` member of the string_list is set. The second\n> > +\tparameter controls if the `util` pointer of the items should be freed\n> > +\tor not.\n> \n> Missed 's/path/string/' here?\n\nGood catch.  I clearly forgot to grep for \"path\" in all the files that I \ntouched.  I did that now, but only looked at comments (in the hope that \nthe compiler would have caught the other ones).\n\n-- snipsnap --\n[PATCH] Fix two leftovers from path_list->string_list\n\nIn the documentation, where you cannot get compile errors for using the\nwrong member name, there were two mentions of 'path' left.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/technical/api-string-list.txt |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt\nindex 92b3ecd..293bb15 100644\n--- a/Documentation/technical/api-string-list.txt\n+++ b/Documentation/technical/api-string-list.txt\n@@ -41,7 +41,7 @@ memset(&list, 0, sizeof(struct string_list));\n string_list_append(\"foo\", &list);\n string_list_append(\"bar\", &list);\n for (i = 0; i < list.nr; i++)\n-\tprintf(\"%s\\n\", list.items[i].path)\n+\tprintf(\"%s\\n\", list.items[i].string)\n ----\n \n NOTE: It is more efficient to build an unsorted list and sort it\n@@ -113,7 +113,7 @@ Data structures\n \n * `struct string_list_item`\n \n-Represents an item of the list. The `path` member is a pointer to the\n+Represents an item of the list. The `string` member is a pointer to the\n string, and you may use the `util` member for any purpose, if you want.\n \n * `struct string_list`\n-- \n1.5.6.2.516.g22071\n"}]}