treewide: include parse-options.h in source files
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>
This commit is contained in:
parent
73876f4861
commit
49fd551194
@ -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"
|
||||
|
@ -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.
|
||||
|
@ -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>"),
|
||||
|
@ -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>]")
|
||||
|
@ -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"
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "strvec.h"
|
||||
#include "object-store.h"
|
||||
#include "packfile.h"
|
||||
#include "parse-options.h"
|
||||
|
||||
struct archive_dir {
|
||||
const char *path;
|
||||
|
@ -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,
|
||||
|
1
remote.c
1
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 };
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user