{"thread":{"id":"40580","subject":"[PATCH] tag.c: use the correct algorithm for the '--contains' option","startedAt":"2015-10-17T18:23:44Z","lastAt":"2015-10-17T18:23:44Z","messageCount":1,"participants":["Karthik Nayak"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"271858","messageId":"1445106224-21013-1-git-send-email-Karthik.188@gmail.com","threadId":"40580","inReplyTo":"AOLa=ZSjNjey3zWozFkyFw-X-BPtsVNpQKqG5hO9-7qJOBR_KA@mail.gmail.com","subject":"[PATCH] tag.c: use the correct algorithm for the '--contains' option","fromName":"Karthik Nayak","fromEmail":"karthik.188@gmail.com","sentAt":"2015-10-17T18:23:44Z","receivedAt":"2015-10-17T18:23:44Z","isPatch":true,"sender":{"key":"karthik.188@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1786334?v=4"},"body":"In b7cc53e92c806b73e14b03f60c17b7c29e52b4a4 we port tag.c to use\nref-filter APIs for filtering and printing refs. But that commit\nmissed out on setting 'filter->with_commit_tag_algo' which would\nensure the correct algorithm is used for the '--contains' option.\nAs reported by Jerry Snitselaar, this causes the option to work way\nslower than expected, fix this by setting 'filter->with_commit_tag_algo'\nin tag.c before calling 'filter_refs()'.\n\nMentored-by: Christian Couder <christian.couder@gmail.com>\nMentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>\nSigned-off-by: Karthik Nayak <karthik.188@gmail.com>\nTested-by: Jerry Snitselaar <jsnitsel@redhat.com>\n---\n builtin/tag.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex 977a18c..2c5a9f1 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -49,6 +49,7 @@ static int list_tags(struct ref_filter *filter, struct ref_sorting *sorting)\n \t\tformat = \"%(refname:short)\";\n \n \tverify_ref_format(format);\n+\tfilter->with_commit_tag_algo = 1;\n \tfilter_refs(&array, filter, FILTER_REFS_TAGS);\n \tref_array_sort(sorting, &array);\n \n-- \n2.6.1\n"}]}