git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] bisect: add read_bisect_terms() to the public interface

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jul 30, 2015, 14:33 UTC
Message-ID
<55BA35A5.2020605@ramsay1.demon.co.uk>

Commit 833bd64f ("bisect: simplify the addition of new bisect terms", 29-06-2015) added a public function, read_bisect_terms(), to 'bisect.c' which was then called by code in 'revision.c', having directly referenced the symbol with an explicit external declaration. This causes sparse to complain ('symbol not declared. Should it be static?').

In order to suppress the warning, move the external declaration to the "bisect.h" header file and '#include' the header in 'revision.c'.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Junio,

You recently mentioned that you may squash a fix to the 'ref-filter' series in next whilst re-winding next. How about squashing this patch into 'ad/bisect-cleanup' at the same time?

As you know, I have been 'up to my eyeballs' lately, so this patch is (almost) a 'five minute quick fix' to the sparse warning. (You know that I prefer to catch these while they are still in pu, but I missed this one ... sorry!) So, if this patch is not appropriate (since I have not followed any of the discussion which lead to this commit), please ignore!

BTW, a large part of 'bisect.h', namely the declartions of BISECT_SHOW_ALL, REV_LIST_QUIET and rev_list_info are only referenced by 'builtin/rev-list.c'. Noticed in passing ...

ATB, Ramsay Jones

 bisect.h   | 2 ++
 revision.c | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/bisect.h b/bisect.h
index 2a6c831..acd12ef 100644
--- a/bisect.h
+++ b/bisect.h
@@ -26,4 +26,6 @@ extern int bisect_next_all(const char *prefix, int no_checkout);
 
 extern int estimate_bisect_steps(int all);
 
+extern void read_bisect_terms(const char **bad, const char **good);
+
 #endif
diff --git a/revision.c b/revision.c
index b6b2cf7..5350139 100644
--- a/revision.c
+++ b/revision.c
@@ -18,6 +18,7 @@
 #include "commit-slab.h"
 #include "dir.h"
 #include "cache-tree.h"
+#include "bisect.h"
 
 volatile show_early_output_fn_t show_early_output;
 
@@ -2079,8 +2080,6 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
 	ctx->argc -= n;
 }
 
-extern void read_bisect_terms(const char **bad, const char **good);
-
 static int for_each_bisect_ref(const char *submodule, each_ref_fn fn, void *cb_data, const char *term) {
 	struct strbuf bisect_refs = STRBUF_INIT;
 	int status;
-- 
2.5.0
Message 1 of 1 in “bisect: add read_bisect_terms() to the public interface”
  1. bisect: add read_bisect_terms() to the public interfaceRamsay Jones, Jul 30, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.