{"thread":{"id":"39971","subject":"[PATCH] bisect: add read_bisect_terms() to the public interface","startedAt":"2015-07-30T14:33:09Z","lastAt":"2015-07-30T14:33:09Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"267139","messageId":"55BA35A5.2020605@ramsay1.demon.co.uk","threadId":"39971","inReplyTo":null,"subject":"[PATCH] bisect: add read_bisect_terms() to the public interface","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2015-07-30T14:33:09Z","receivedAt":"2015-07-30T14:33:09Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit 833bd64f (\"bisect: simplify the addition of new bisect terms\",\n29-06-2015) added a public function, read_bisect_terms(), to 'bisect.c'\nwhich was then called by code in 'revision.c', having directly referenced\nthe symbol with an explicit external declaration. This causes sparse to\ncomplain ('symbol not declared. Should it be static?').\n\nIn order to suppress the warning, move the external declaration to the\n\"bisect.h\" header file and '#include' the header in 'revision.c'.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nYou recently mentioned that you may squash a fix to the 'ref-filter'\nseries in next whilst re-winding next. How about squashing this patch\ninto 'ad/bisect-cleanup' at the same time?\n\nAs you know, I have been 'up to my eyeballs' lately, so this patch is\n(almost) a 'five minute quick fix' to the sparse warning. (You know that\nI prefer to catch these while they are still in pu, but I missed this\none ... sorry!) So, if this patch is not appropriate (since I have not\nfollowed any of the discussion which lead to this commit), please ignore!\n\nBTW, a large part of 'bisect.h', namely the declartions of BISECT_SHOW_ALL,\nREV_LIST_QUIET and rev_list_info are only referenced by 'builtin/rev-list.c'.\nNoticed in passing ...\n\nATB,\nRamsay Jones\n\n bisect.h   | 2 ++\n revision.c | 3 +--\n 2 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/bisect.h b/bisect.h\nindex 2a6c831..acd12ef 100644\n--- a/bisect.h\n+++ b/bisect.h\n@@ -26,4 +26,6 @@ extern int bisect_next_all(const char *prefix, int no_checkout);\n \n extern int estimate_bisect_steps(int all);\n \n+extern void read_bisect_terms(const char **bad, const char **good);\n+\n #endif\ndiff --git a/revision.c b/revision.c\nindex b6b2cf7..5350139 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -18,6 +18,7 @@\n #include \"commit-slab.h\"\n #include \"dir.h\"\n #include \"cache-tree.h\"\n+#include \"bisect.h\"\n \n volatile show_early_output_fn_t show_early_output;\n \n@@ -2079,8 +2080,6 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,\n \tctx->argc -= n;\n }\n \n-extern void read_bisect_terms(const char **bad, const char **good);\n-\n static int for_each_bisect_ref(const char *submodule, each_ref_fn fn, void *cb_data, const char *term) {\n \tstruct strbuf bisect_refs = STRBUF_INIT;\n \tint status;\n-- \n2.5.0\n"}]}