{"thread":{"id":"36231","subject":"[PATCH v3 1/2][GSoC] diff-no-index: rename read_directory()","startedAt":"2014-03-19T15:58:21Z","lastAt":"2014-03-19T19:15:31Z","messageCount":4,"participants":["Brian Bourn","Junio C Hamano","Eric Sunshine"],"isPatch":true,"patchVersion":3,"patchTotal":2},"messages":[{"id":"237080","messageId":"1395244702-659-1-git-send-email-ba.bourn@gmail.com","threadId":"36231","inReplyTo":null,"subject":"[PATCH v3 1/2][GSoC] diff-no-index: rename read_directory()","fromName":"Brian Bourn","fromEmail":"ba.bourn@gmail.com","sentAt":"2014-03-19T15:58:21Z","receivedAt":"2014-03-19T15:58:21Z","isPatch":true,"sender":{"key":"ba.bourn@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3165958?v=4"},"body":"It would be desirable to replace manual checking of \".\" or \"..\"\nin diff-no-index.c with is_dot_or_dotdot(), which is defined\nin dir.h, however, dir.h declares a read_directory() which conflicts\nwith a (different) static read_directory() defined\nin diff-no-index.c. As a preparatory step, rename the local\nread_directory() to avoid the collision.\n\nSigned-off-by: Brian Bourn <ba.bourn@gmail.com>\n---\nPart 1 of my submission for GSoC\n diff-no-index.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex 8e10bff..ec51106 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -16,7 +16,7 @@\n #include \"builtin.h\"\n #include \"string-list.h\"\n \n-static int read_directory(const char *path, struct string_list *list)\n+static int read_directory_contents(const char *path, struct string_list *list)\n {\n \tDIR *dir;\n \tstruct dirent *e;\n@@ -107,9 +107,9 @@ static int queue_diff(struct diff_options *o,\n \t\tint i1, i2, ret = 0;\n \t\tsize_t len1 = 0, len2 = 0;\n \n-\t\tif (name1 && read_directory(name1, &p1))\n+\t\tif (name1 && read_directory_contents(name1, &p1))\n \t\t\treturn -1;\n-\t\tif (name2 && read_directory(name2, &p2)) {\n+\t\tif (name2 && read_directory_contents(name2, &p2)) {\n \t\t\tstring_list_clear(&p1, 0);\n \t\t\treturn -1;\n \t\t}\n-- \n1.9.0\n"},{"id":"237081","messageId":"1395244702-659-2-git-send-email-ba.bourn@gmail.com","threadId":"36231","inReplyTo":"1395244702-659-1-git-send-email-ba.bourn@gmail.com","subject":"[PATCH v3 2/2][GSoC] diff-no-index: replace manual \".\"/\"..\" check with is_dot_or_dotdot()","fromName":"Brian Bourn","fromEmail":"ba.bourn@gmail.com","sentAt":"2014-03-19T15:58:22Z","receivedAt":"2014-03-19T15:58:22Z","isPatch":true,"sender":{"key":"ba.bourn@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3165958?v=4"},"body":"Signed-off-by: Brian Bourn <ba.bourn@gmail.com>\n---\nPart 2 of my submission for GSoC\n diff-no-index.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex ec51106..c554691 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -15,6 +15,7 @@\n #include \"log-tree.h\"\n #include \"builtin.h\"\n #include \"string-list.h\"\n+#include \"dir.h\"\n \n static int read_directory_contents(const char *path, struct string_list *list)\n {\n@@ -25,7 +26,7 @@ static int read_directory_contents(const char *path, struct string_list *list)\n \t\treturn error(\"Could not open directory %s\", path);\n \n \twhile ((e = readdir(dir)))\n-\t\tif (strcmp(\".\", e->d_name) && strcmp(\"..\", e->d_name))\n+\t\tif (!is_dot_or_dotdot(e->d_name))\n \t\t\tstring_list_insert(list, e->d_name);\n \n \tclosedir(dir);\n-- \n1.9.0\n"},{"id":"237098","messageId":"xmqqd2hi3ury.fsf@gitster.dls.corp.google.com","threadId":"36231","inReplyTo":"1395244702-659-1-git-send-email-ba.bourn@gmail.com","subject":"Re: [PATCH v3 1/2][GSoC] diff-no-index: rename read_directory()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-19T18:31:13Z","receivedAt":"2014-03-19T18:31:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Bourn <ba.bourn@gmail.com> writes:\n\n> It would be desirable to replace manual checking of \".\" or \"..\"\n> in diff-no-index.c with is_dot_or_dotdot(), which is defined\n> in dir.h, however, dir.h declares a read_directory() which conflicts\n> with a (different) static read_directory() defined\n> in diff-no-index.c. As a preparatory step, rename the local\n> read_directory() to avoid the collision.\n>\n> Signed-off-by: Brian Bourn <ba.bourn@gmail.com>\n> ---\n> Part 1 of my submission for GSoC\n>  diff-no-index.c | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n\nLooks good to me.  Doesn't Eric deserve a \"Helped-by:\" above?\n\nThanks.\n\n> diff --git a/diff-no-index.c b/diff-no-index.c\n> index 8e10bff..ec51106 100644\n> --- a/diff-no-index.c\n> +++ b/diff-no-index.c\n> @@ -16,7 +16,7 @@\n>  #include \"builtin.h\"\n>  #include \"string-list.h\"\n>  \n> -static int read_directory(const char *path, struct string_list *list)\n> +static int read_directory_contents(const char *path, struct string_list *list)\n>  {\n>  \tDIR *dir;\n>  \tstruct dirent *e;\n> @@ -107,9 +107,9 @@ static int queue_diff(struct diff_options *o,\n>  \t\tint i1, i2, ret = 0;\n>  \t\tsize_t len1 = 0, len2 = 0;\n>  \n> -\t\tif (name1 && read_directory(name1, &p1))\n> +\t\tif (name1 && read_directory_contents(name1, &p1))\n>  \t\t\treturn -1;\n> -\t\tif (name2 && read_directory(name2, &p2)) {\n> +\t\tif (name2 && read_directory_contents(name2, &p2)) {\n>  \t\t\tstring_list_clear(&p1, 0);\n>  \t\t\treturn -1;\n>  \t\t}\n"},{"id":"237105","messageId":"CAPig+cSew=zjhC54w4LGipaXCD7+M=7pXShh6hoYBo_krRTkbg@mail.gmail.com","threadId":"36231","inReplyTo":"xmqqd2hi3ury.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v3 1/2][GSoC] diff-no-index: rename read_directory()","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2014-03-19T19:15:31Z","receivedAt":"2014-03-19T19:15:31Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Mar 19, 2014 at 2:31 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Brian Bourn <ba.bourn@gmail.com> writes:\n>\n>> It would be desirable to replace manual checking of \".\" or \"..\"\n>> in diff-no-index.c with is_dot_or_dotdot(), which is defined\n>> in dir.h, however, dir.h declares a read_directory() which conflicts\n>> with a (different) static read_directory() defined\n>> in diff-no-index.c. As a preparatory step, rename the local\n>> read_directory() to avoid the collision.\n>>\n>> Signed-off-by: Brian Bourn <ba.bourn@gmail.com>\n>> ---\n>> Part 1 of my submission for GSoC\n>>  diff-no-index.c | 6 +++---\n>>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> Looks good to me.  Doesn't Eric deserve a \"Helped-by:\" above?\n\nBoth patches look good to me too.\n\nOne final comment for future submissions (no need to resend this one):\nAs a courtesy to reviewers, below the \"---\" line after your sign-off,\nprovide a link to the previous attempt (like this [1]) and explain\nwhat changed since the since the last version.\n\n[1]: http://thread.gmane.org/gmane.comp.version-control.git/244412\n\n>> diff --git a/diff-no-index.c b/diff-no-index.c\n>> index 8e10bff..ec51106 100644\n>> --- a/diff-no-index.c\n>> +++ b/diff-no-index.c\n>> @@ -16,7 +16,7 @@\n>>  #include \"builtin.h\"\n>>  #include \"string-list.h\"\n>>\n>> -static int read_directory(const char *path, struct string_list *list)\n>> +static int read_directory_contents(const char *path, struct string_list *list)\n>>  {\n>>       DIR *dir;\n>>       struct dirent *e;\n>> @@ -107,9 +107,9 @@ static int queue_diff(struct diff_options *o,\n>>               int i1, i2, ret = 0;\n>>               size_t len1 = 0, len2 = 0;\n>>\n>> -             if (name1 && read_directory(name1, &p1))\n>> +             if (name1 && read_directory_contents(name1, &p1))\n>>                       return -1;\n>> -             if (name2 && read_directory(name2, &p2)) {\n>> +             if (name2 && read_directory_contents(name2, &p2)) {\n>>                       string_list_clear(&p1, 0);\n>>                       return -1;\n>>               }\n"}]}