]> git.ipfire.org Git - thirdparty/git.git/commitdiff
treewide: include parse-options.h in source files
authorSZEDER Gábor <szeder.dev@gmail.com>
Sun, 19 Mar 2023 16:27:11 +0000 (17:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Mar 2023 18:26:47 +0000 (11:26 -0700)
The builtins 'ls-remote', 'pack-objects', 'receive-pack', 'reflog' and
'send-pack' use parse_options(), but their source files don't directly
include 'parse-options.h'.  Furthermore, the source files
'diagnose.c', 'list-objects-filter-options.c', 'remote.c' and
'send-pack.c' define option parsing callback functions, while
'revision.c' defines an option parsing helper function, and thus need
access to various fields in 'struct option' and 'struct
parse_opt_ctx_t', but they don't directly include 'parse-options.h'
either.  They all can still be built, of course, because they include
one of the header files that does include 'parse-options.h' (though
unnecessarily, see the next commit).

Add those missing includes to these files, as our general rule is that
"a C file must directly include the header files that declare the
functions and the types it uses".

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-remote.c
builtin/pack-objects.c
builtin/receive-pack.c
builtin/reflog.c
builtin/send-pack.c
diagnose.c
list-objects-filter-options.c
remote.c
revision.c
send-pack.c

index 6516177348996cd6e73d69e5c3884e53e6dfda73..d8aa30fb4df9a8eedb28a5c3d4c9b0bb6f034ec3 100644 (file)
@@ -4,6 +4,7 @@
 #include "ref-filter.h"
 #include "remote.h"
 #include "refs.h"
+#include "parse-options.h"
 
 static const char * const ls_remote_usage[] = {
        N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
index 74a167a180cd4080919d8c3a614c098ad96a2b42..476ecff264bc64eeebd3645df9ccea9f80494dec 100644 (file)
@@ -37,6 +37,7 @@
 #include "shallow.h"
 #include "promisor-remote.h"
 #include "pack-mtimes.h"
+#include "parse-options.h"
 
 /*
  * Objects we are going to pack are collected in the `to_pack` structure.
index cd5c7a28eff08f048b79a9d739800709c443c160..f85f72a183b6320c60ea1794f9b028b63e671cf6 100644 (file)
@@ -30,6 +30,7 @@
 #include "commit-reach.h"
 #include "worktree.h"
 #include "shallow.h"
+#include "parse-options.h"
 
 static const char * const receive_pack_usage[] = {
        N_("git receive-pack <git-dir>"),
index 270681dcdf40e3c7ff0bf2969340eb1b981cf8e8..9b000bb6bcaf0fe8f243e01b236bdeb341b1ca6e 100644 (file)
@@ -4,6 +4,7 @@
 #include "reachable.h"
 #include "worktree.h"
 #include "reflog.h"
+#include "parse-options.h"
 
 #define BUILTIN_REFLOG_SHOW_USAGE \
        N_("git reflog [show] [<log-options>] [<ref>]")
index 4c5d125fa0a1cb4a01deac04637bd4e71763c619..15adc1ddcb149ce641570486b8698e7f48d56c42 100644 (file)
@@ -15,6 +15,7 @@
 #include "gpg-interface.h"
 #include "gettext.h"
 #include "protocol.h"
+#include "parse-options.h"
 
 static const char * const send_pack_usage[] = {
        N_("git send-pack [--mirror] [--dry-run] [--force]\n"
index 8f2656989666b67a3281d29a83f73ff82a006a1d..b7a29612dae6d5c8405491d0de6ce934c279b542 100644 (file)
@@ -7,6 +7,7 @@
 #include "strvec.h"
 #include "object-store.h"
 #include "packfile.h"
+#include "parse-options.h"
 
 struct archive_dir {
        const char *path;
index ee01bcd2cc365c12c72bcd3f5597ecceecb2a7d9..33134159d7dc822bea00237337182d6ed3b71409 100644 (file)
@@ -9,6 +9,7 @@
 #include "promisor-remote.h"
 #include "trace.h"
 #include "url.h"
+#include "parse-options.h"
 
 static int parse_combine_filter(
        struct list_objects_filter_options *filter_options,
index 60869beebe7364a594cd45938d4ed97dcdd28840..c17827fa8ea98e723acb918bd888160127125aaa 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -15,6 +15,7 @@
 #include "commit-reach.h"
 #include "advice.h"
 #include "connect.h"
+#include "parse-options.h"
 
 enum map_direction { FROM_SRC, FROM_DST };
 
index 21f5f572c22ec7054da6bc20fef26ee2a59a19d5..4acc1c81b06774df2eea95e8c593b4ce7133a3b2 100644 (file)
@@ -35,6 +35,7 @@
 #include "json-writer.h"
 #include "list-objects-filter-options.h"
 #include "resolve-undo.h"
+#include "parse-options.h"
 
 volatile show_early_output_fn_t show_early_output;
 
index f2e19838c9c342b3b9d6df5e9bf24d0add0d47d1..c87122d91319a2dd799f7288f218386ed4e1bb03 100644 (file)
@@ -16,6 +16,7 @@
 #include "gpg-interface.h"
 #include "cache.h"
 #include "shallow.h"
+#include "parse-options.h"
 
 int option_parse_push_signed(const struct option *opt,
                             const char *arg, int unset)