Skip to content

Commit 49fd551

Browse files
szedergitster
authored andcommitted
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 <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 73876f4 commit 49fd551

File tree

10 files changed

+10
-0
lines changed

10 files changed

+10
-0
lines changed

builtin/ls-remote.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "ref-filter.h"
55
#include "remote.h"
66
#include "refs.h"
7+
#include "parse-options.h"
78

89
static const char * const ls_remote_usage[] = {
910
N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"

builtin/pack-objects.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "shallow.h"
3838
#include "promisor-remote.h"
3939
#include "pack-mtimes.h"
40+
#include "parse-options.h"
4041

4142
/*
4243
* Objects we are going to pack are collected in the `to_pack` structure.

builtin/receive-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "commit-reach.h"
3131
#include "worktree.h"
3232
#include "shallow.h"
33+
#include "parse-options.h"
3334

3435
static const char * const receive_pack_usage[] = {
3536
N_("git receive-pack <git-dir>"),

builtin/reflog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "reachable.h"
55
#include "worktree.h"
66
#include "reflog.h"
7+
#include "parse-options.h"
78

89
#define BUILTIN_REFLOG_SHOW_USAGE \
910
N_("git reflog [show] [<log-options>] [<ref>]")

builtin/send-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "gpg-interface.h"
1616
#include "gettext.h"
1717
#include "protocol.h"
18+
#include "parse-options.h"
1819

1920
static const char * const send_pack_usage[] = {
2021
N_("git send-pack [--mirror] [--dry-run] [--force]\n"

diagnose.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "strvec.h"
88
#include "object-store.h"
99
#include "packfile.h"
10+
#include "parse-options.h"
1011

1112
struct archive_dir {
1213
const char *path;

list-objects-filter-options.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "promisor-remote.h"
1010
#include "trace.h"
1111
#include "url.h"
12+
#include "parse-options.h"
1213

1314
static int parse_combine_filter(
1415
struct list_objects_filter_options *filter_options,

remote.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "commit-reach.h"
1616
#include "advice.h"
1717
#include "connect.h"
18+
#include "parse-options.h"
1819

1920
enum map_direction { FROM_SRC, FROM_DST };
2021

revision.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "json-writer.h"
3636
#include "list-objects-filter-options.h"
3737
#include "resolve-undo.h"
38+
#include "parse-options.h"
3839

3940
volatile show_early_output_fn_t show_early_output;
4041

send-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "gpg-interface.h"
1717
#include "cache.h"
1818
#include "shallow.h"
19+
#include "parse-options.h"
1920

2021
int option_parse_push_signed(const struct option *opt,
2122
const char *arg, int unset)

0 commit comments

Comments
 (0)