From c4d9c79378e9108358c3f20e27bc437754cd805d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Sun, 19 Mar 2023 17:27:12 +0100 Subject: treewide: remove unnecessary inclusions of parse-options.h from headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The headers 'diagnose.h', 'list-objects-filter-options.h', 'ref-filter.h' and 'remote.h' declare option parsing callback functions with a 'struct option*' parameter, and 'revision.h' declares an option parsing helper function taking 'struct parse_opt_ctx_t*' and 'struct option*' parameters. These headers all include 'parse-options.h', although they don't need any of the type definitions from that header file. Furthermore, 'list-objects-filter-options.h' and 'ref-filter.h' also define some OPT_* macros to initialize a 'struct option', but these don't necessitate the inclusion of parse-options.h in these headers either, because these macros are only expanded in source files. Remove these unnecessary inclusions of parse-options.h and use forward declarations to declare the necessary types. After this patch none of the header files include parse-options.h anymore. With these changes, the build time after modifying only parse-options.h is reduced by about 30%, and the number of targets built is almost 20% less: Before: $ touch parse-options.h && time make -j4 |wc -l 353 real 1m1.527s user 3m32.205s sys 0m15.903s After: 289 real 0m39.285s user 2m12.540s sys 0m11.164s Signed-off-by: SZEDER Gábor Reviewed-by: Elijah Newren Signed-off-by: Junio C Hamano --- remote.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'remote.h') diff --git a/remote.h b/remote.h index 1ebbe42792..92eccf22ec 100644 --- a/remote.h +++ b/remote.h @@ -2,10 +2,10 @@ #define REMOTE_H #include "cache.h" -#include "parse-options.h" #include "hashmap.h" #include "refspec.h" +struct option; struct transport_ls_refs_options; /** -- cgit v1.2.3